website icon indicating copy to clipboard operation
website copied to clipboard

Is runFork really the preferred method for running effects?

Open tmcw opened this issue 1 year ago • 0 comments

What is the type of issue?

Documentation is confusing

What is the issue?

The docs for runFork say that

Unless you have a specific need for a Promise or a synchronous operation, Effect.runFork is the recommended choice.

This is confusing to me:

The only example of using runFork in the running effects documentation is extremely contrived - if I wanted to, say, "get the result of the effect," I have no idea how to do that. It seems like i'd interrupt the fiber intermittently until it returns, but that seems weird, inefficient, and very different from the norms of promises or async/await or anything else in TS, and there are no examples of doing that.

Where did you find it?

https://effect.website/docs/guides/essentials/running-effects#runfork

tmcw avatar Oct 17 '24 15:10 tmcw