Difference between Runtime.runFork and Effect.fork in spawning fibers
What is the difference in running forks using
I am building a socket server and I want to have one fiber that is listening on client connections adding them to ref and another that sends a data to all connections periodically (let's say every 3 seconds or so). To do that I need to spawn a new fiber that listens for new connections.
But I found a multiple ways of how to do that. The most straight forward is this one:
another one is using runtime:
My question is how do those two ways differ? I understand that the
Runtime.runFork vs Effect.fork ?I am building a socket server and I want to have one fiber that is listening on client connections adding them to ref and another that sends a data to all connections periodically (let's say every 3 seconds or so). To do that I need to spawn a new fiber that listens for new connections.
But I found a multiple ways of how to do that. The most straight forward is this one:
another one is using runtime:
My question is how do those two ways differ? I understand that the
Runtime.runFork function is useful when I need to run the fiber outside of the generator (in express for example). Is that just syntax difference or is there any other difference that is good to know about?