Skip to content
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

Allow "unsafe" creation of a Queue #8871

Merged
merged 3 commits into from
May 19, 2024

Conversation

kyri-petrou
Copy link
Contributor

@kyri-petrou kyri-petrou commented May 18, 2024

In zio-http, there are a few places where we need to create a queue "unsafely". Currently, this is done but unsafely running the effect, but this is both inefficient and also dangerous as we might end up blocking in cases that the effect might also perform some asynchronous tasks.

With this PR, we expose an option (currently available only to the zio namespace) to create a queue without running an effect

EDIT: Decided to make the object public. I really don't see a reason why we don't want to give users the option to do this

@ghostdogpr
Copy link
Member

Any place it could be used internally?

@kyri-petrou
Copy link
Contributor Author

Any place it could be used internally?

There seem to be a few places it can potentially be used, but in almost all of those places it's composed with other effects so not sure if there's any benefit to do that

@kyri-petrou kyri-petrou merged commit 08d157c into zio:series/2.x May 19, 2024
21 checks passed
@kyri-petrou kyri-petrou deleted the allow-unsafe-queue-creation branch May 19, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants