Sebastian,

Thanks for the quick reply. :)

Just to get a better idea as to whether this is a misunderstanding or error 
>> on my part: Is EventEmitter's event subscription mechanism supposed to work 
>> in forking environments (Mojolicious prefork, default IOLoop)?
>>
>
> Not across processes.
>  
>
>> I'm pretty sure that this is because EventEmitter doesn't integrate with 
>> the IOLoop; is there a better mechanism to implement a means of 
>> cross-controller notification which works with forking?
>>
>
> Use a database, many like Redis pub/sub.
>

That's the type of thing I was afraid I'd have to resort to.  AnyEvent + 
ZeroMQ might be another option, but both are overkill for my usage 
scenario, so I'll resort to polling the existing MongoDB for new records, 
as I currently only need it for providing new entries in an event log, and 
the web app will not have to deal with larger numbers of concurrent users.

However, doesn't the fact that one has to go to these lengths (integrating 
additional infrastructure and, in the case of Redis, even an additional 
server) rather limit the utility of Mojolicious's WebSocket?  Typically, a 
WebSocket will rely on some event-driven means of data acquisition in the 
backend, and in the status quo, this consequently requires (a) relying on 
additional infrastructure (which, if nothing else, complicates automated 
testing), (b) limiting scalability by disallowing multi-process contexts, 
or (c) resorting to polling (which doesn't scale either).  Are there any 
plans to incorporate a “native” inter-process event system in the future to 
facilitate application scenarios where controllers interact?


Marco

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to