-
Notifications
You must be signed in to change notification settings - Fork 12
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
Bluefin and concurrency #28
Comments
Oh great, I'm pleased to hear it! Bluefin's This is a good opportunity for me to improve the concurrency story though. Could you tell me what concurrency patterns you want to use? And maybe point me to what you're doing with concurrency in the current version? |
Huh, well. I think all concurrency is limited to the function:
<https://github.com/maralorn/nix-output-monitor/blob/main/lib%2FNOM%2FIO.hs#L228>
And looking at it more concretely I don't see any weird interactions between handles and concurrency there. All data sharing between threads is done explicitly via STM.
One part of that function builds and consumes a streamly stream. But that is not concurrent in itself I think. On the other hand I just use race_ und concurrently_ to launch the output and the input thread in parallel.
So I could imagine just giving it a shot and telling you if encounter troubles.
Am 24. November 2024 21:50:24 MEZ schrieb tomjaguarpaw ***@***.***>:
…> Hey Tom, still loving your lib. (And loved your recent talk on effectful vs. bluefin.)
Oh great, I'm pleased to hear it!
Bluefin's `State` is not thread safe so I wouldn't recommend just using `async` unless you're very careful.
This is a good opportunity for me to improve the concurrency story though. Could you tell me what concurrency patterns you want to use? And maybe point me to what you're doing with concurrency in the current version?
--
Reply to this email directly or view it on GitHub:
#28 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
OK, in that case you will be fine to use
Sounds good. Please let me know how it goes! |
See also #34 for some discussion on native concurrency primitives. |
Hey Tom, still loving your lib. (And loved your recent talk on effectful vs. bluefin.)
I am considering to port https://github.com/maralorn/nix-output-monitor to bluefin which currently uses transformers and streamly.
For this I noticed that bluefin currently does not mention concurrency anywhere. So I would like to know whether you have any recommendations for combining bluefin with concurrency. (e.g. can I just use it with async?)
I am especially curious about State and Stream and whether I can just pass them to different threads.
The text was updated successfully, but these errors were encountered: