-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why not Dispatcher? #334
Comments
Thanks for opening the issue! It's a good question, and I think we can revisit this design choice.
Here are three advantages of using
Yes and no :) point (3) above is a good motivation to create a dispatcher when the lambda starts and use it to handle all incoming requests. The question is, how will we get that dispatcher? Since the only way to create a So, we will still need Does that answer your question? Thanks, and PRs welcome for this :) |
So are you suggesting that with both Feral and my work, we should bootstrap a Dispatcher like a resource for the lifetime of the lambda, and then continually use that Dispatcher for the times when we need to be unsafe? |
Yes, exactly. It seems to me that an application should never have to call |
Shout out @kamilkloch :) |
Hello from Scalar 2023 in Warsaw! I saw a presentation by Kamil Kloch about cats-effect and learned about Dispatcher being the go-to mechanism for running IO's in unsafe territory.
I'm in a position where I've home-rolled a solution that is similar to Feral (build a resource, manually initialize, toss away the finalizer bc lifetimes are hard) and in the last mile call
unsafeRunSync
.The presentation I watched was advocating that there shouldn't be a reason to do that and just use a Dispatcher
.use()
instead "because reasons". Something about the Dispatcher having a better handle on initializing what is required to run IOs?unsafeRunSync
with a Dispatcher per the advice above? Is there some nuance/extra dimension we are missing?Edit: I believe Dispatcher thoughts are a continuation on #33
The text was updated successfully, but these errors were encountered: