ratchetphp / Ratchet

Asynchronous WebSocket server
http://socketo.me
MIT License
6.21k stars 716 forks source link

Ratchet without ZeroMQ library #669

Open Shkarbatov opened 5 years ago

Shkarbatov commented 5 years ago

Hi all!

Can I use Ratchet without ZeroMQ library? And what about ssl, can I work with it?

Can i fork running php process with Ratchet and can children process restart if it will die?

cboden commented 5 years ago

Can I use Ratchet without ZeroMQ library?

Yes, that tutorial is a demonstration, which was one of many ways to incorporate an evented system into a procedural system.

And what about ssl, can I work with it?

React's TCP library supports SSL, so yes. However, I would recommend using Nginx as a SSL terminator proxy.

Can i fork running php process with Ratchet and can children process restart if it will die?

I don't think you want to fork a process, but checkout React's ChildProcess.

Shkarbatov commented 5 years ago

Yes, that tutorial is a demonstration, which was one of many ways to incorporate an evented system into a procedural system.

Can you please give me some link to example without ZeroMQ. I need client connect from browser, and send data to client from back to browser. like this: https://github.com/Shkarbatov/WebSocketPHPWorkerman/blob/master/worker.php

I don't think you want to fork a process, but checkout React's ChildProcess.

Yes, correct, thanks!

cboden commented 5 years ago

Checkout Pawl while following the ZeroMQ tutorial. Just replace ZeroMQ with Pawl.

Shkarbatov commented 5 years ago

Is this correct? https://github.com/Shkarbatov/WebSocketPHPRatchet

I don't think you want to fork a process, but checkout React's ChildProcess.

If I need to run 4 workers, do I have something like this in Ratchet:

// 4 processes
$ws_worker->count = 4;