Category : reactphp

It seems its possible to use Guzzle Library to download asynchronously with ReactPHP. Reference https://github.com/guzzle/promises#promise-interop this is what I have tried: but finish working without doing anything. what should I do? I do not want to Guzzle block the Async flow. use GuzzleHttpClient; use ReactEventLoopLoop; use ReactPromiseDeferred; public function handle() { $loop = Loop::get(); $loop->addTimer(1,function ..

Read more

I want to send data to ratchet via class in php to send it to client send data through JavaScript var conn = new WebSocket(‘ws://localhost:6001/’); conn.onmessage = function(e) { console.log(e.data); }; conn.onopen = function(e) { conn.send(‘Hi’); }; But I want to send data to ratchet via php for send notification How do I do this? ..

Read more

I want to use reactphp socket for push notifications in laravel but I do not know what to do? route: Route::get(‘/test’, function () { event(new testEvent($test)); }); event: public $test; public function __construct($test) { $this->test = $test; } public function broadcastOn() { return new PrivateChannel(‘test.’ . $this->test->id); } channel: Broadcast::channel(‘test.{test}’, function ($user, $id) { return ..

Read more