Lev Perlman
1 min readDec 19, 2018

--

Hey Sunny!

Thank you for commenting!

Sure thing, here’s the explanation:

So, Faye has an API endpoint to which consumers connect to in order to listen and publishers connect to in order to publish. It’s a web endpoint, accessible from any instance.

It has a separate dedicated thread which listens to Redis using EventMachine loop (constantly pinging redis for new information).
When a client makes an API request to publish an event, the Faye middleware receives that call and pushes the event to Redis.

The Faye EM listener loop — is constantly looking for new stuff on Redis, so as soon as something is published — it consumes it and sends the data to all listeners on that channel.

Makes sense?

Please let me know if you have any more questions :)

--

--

No responses yet