Difference between Runtime.runFork and Effect.fork in spawning fibers

What is the difference in running forks using 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:

 yield* _(
      Effect.fork(Stream.runForEach(connectionStream, initializeConnection))
    )


another one is using runtime:
    const runFork = Runtime.runFork(yield* _(Effect.runtime<OpenConnections>()))
    runFork(Stream.runForEach(connectionStream, initializeConnection))


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?
Was this page helpful?