[zeromq-dev] Using 0mq in a Web application
David Mitchell
jdavidmitchell at gmail.com
Wed Mar 14 17:35:46 CET 2012
I was able to get tcp to work (apache 2.0 with mod_php) . However,
ipc did not work using apache 2.0 with mod_php. I also had some
problems with SELinux (with CentOS), but without SELinux in enforcing
mode, tcp worked for me.
I am trying to implement a "Divide and Conquer" strategy (http://
zguide.zeromq.org/php:all#header-10). I have a bunch of JSON objects
that I would like workers to process. I would like to pass the JSON
from the Web application to the workers. I am not really sure how to
do this, but in my current attempt, I set up a controller (or a
ventilator) to create all of the sockets that I need.
Controller (or a ventilator)
http://pastebin.com/dhDexuhH
Worker
http://pastebin.com/BVtC1Uz9
At the moment, I am not getting any events to any of the workers.
Thank you for your help.
David
On Mar 14, 11:30 am, Ian Barber <ian.bar... at gmail.com> wrote:
> On Wed, Mar 14, 2012 at 2:41 AM, David Mitchell <jdavidmitch... at gmail.com>wrote:
>
>
>
> > Is is possible when running a PHP script under mod_php or CGI and an
> > Apache Web server to bind or connect to a TCP or IPC socket? I can
> > bind and connect when using the PHP CLI, but the connection just hangs
> > when making a send or recv call from within a Web application.
>
> Absolutely, but you need something to be running on the other side to
> receive the message. For that kind of situation you'd have a queue server
> bind() and recv() messages in a loop, and the web workers connect(),
> send(), their message and quite. I would definitely recommend reading the
> guide (http://zero.mq/zg) before diving in though.
>
> Ian
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-... at lists.zeromq.orghttp://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list