swoole_server->addProcess

���һ���û��Զ���Ĺ������̡�

bool swoole_server->addProcess(swoole_process $process);

�˺���ͨ�����ڴ���һ������Ĺ������̣����ڼ�ء��ϱ������������������

�ӽ��̻��йܵ�Manager���̣����������������manager���̻����´���һ��
�ӽ����ڲ���ʹ��swoole_server->task/taskwait�ӿ�
�˺�����swoole-1.7.9���ϰ汾����

ʾ������

$server = new swoole_server('127.0.0.1', 9501);

$process = new swoole_process(function($process) use ($server) {
    while (true) {
        $msg = $process->read();
        foreach($server->connections as $conn) {
            $server->send($conn, $msg);
        }
    }
});

$server->addProcess($process);

$server->on('receive', function ($serv, $fd, $from_id, $data) use ($process) {
    //Ⱥ���յ�����Ϣ
    $process->write($data);
});

$server->start();