Posts List

Live Process Output To The User With Redis and Server-Sent Events

In a recent project I needed to collect the output from a process that was occurring on the server and output it to the user on the frontend. Ideally that would occur in nearly real time. The process I needed to collect output from is a third-party library that outputs everything to STDOUT or STDERR. The easiest way for me to accomplish that without shenanigans was to create a module to run the library and then fork the module as a child process and then pipe the output to a stream handler.