Open remicollet opened 6 years ago
@Lukaum dont know to whom this question was addressed, but if to me - I went onto Workerman + websockets to implement push notifications broker
@nop1984 Great answer!
I read every topic about change or similar lib for the zmq in ratchet, for this push purpose. But don't had a clear answer (until at this moment).
Tried the Swoole php (in virtual machine with centos8), but its hard to implement and use (principally in windows so).
Think this wokerman its a best solution. Gonna use!
@Lukaum Swoole must be the fastest for PHP, but I don't need great speed much + wish to avoid installing extra php-ext because this for public drupal module. Workerman is also fast + it is very basic and simple, easy to start. But things got complex when trying not to duplicate logic in each callback, so it took me near week to imagine a model and write a helper where basically I describe the operation as an array of callbacks, kinds "chain" or "tree" and run it. So with it I can write almost classic OOP with fine logic, except functions more divided into smaller, join then all in 1 function into the "chain" array, also provide $this context and agrs in same array, and run that 'chain' array, with state sync inside class properties.
@nop1984 In my case, i just need to use websocket for a "real time" notifications, and only send this data for employees (in admin panel).
For ratchet i found a solution. It works well when data comes from client-side, but i have a webhook comes from a payment gateway to my server, so thats why i need the push (update some row in db and transmit for some websocket connections, thats is the problem without the zmq).
@Lukaum seems almost same I do: realtime push notification for client and support crew, via inpage js (toasts) and via browser Notification API with "webhooks" to update message status on backend (if it was delivered, if was interacted by user). With redis based middleware storage for better speed (not to call "webhooks" and other things per event but per timer). But without ZMQ, just workerman + redis on server and js ServiceWorker & page script on client.
Just to share my experience, I was unable to get php-7.4.4-zmq-1.1.4-4.3.2-x64-vc15-zts-nts.zip from the following link to work.
https://github.com/zeromq/php-zmq/issues/193#issuecomment-605456811
Tried to rename or not rename those dll files, or put libzmq.dll into apache/bin folder, always get:
PHP Warning: PHP Startup: Unable to load dynamic library 'php_zmq.dll' (tried: D:\xampp\php\ext\php_zmq.dll (The specified module could not be found.), D:\xampp\php\ext\php_php_zmq.dll.dll (The specified module could not be found.)) in Unknown on line 0
I am running XAMP with PHP 7.4.23 X64 on Windows 11. On the same machine, XAMPP with PHP 7.2.34 works fine with PHP-ZMQ,
Guys, can anyone share a php_zmq to PHP8.2 or 8.1 NTS?? Please!! Or at least give instructions in how to compile! Thank you
Just Did it guys, feel free to test
It also builds and passing tests on PHP 8.3
Paulo, do you have a TS version? Obrigado.
the TS version you can find here: https://github.com/stijnvdb88/php-zmq/releases/tag/v4.3.4
I made a new ZIP with the instructions and the correct files to everyone! Now its everting working
ZMQ-4.3.4_x64_PHP8.2.10-NTS.zip
:D
Build can be fix with pr #190 but is not enough as we encounter segfault during test suite