-
Notifications
You must be signed in to change notification settings - Fork 416
Channels #49
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Conflicts: lib/concurrent.rb
It's OK with me if you want to merge it. Thread pools are my main motivation for a prerelease, since they are used by several other classes (especially Future). But we can include anything else that is "complete" enough for people to start experimenting with. I trust your judgement. |
Ok, I think we could merge:
In next days I'll start writing doc |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First channel implementation is ready.
It uses a simple lock-based solution and the
select
semantic is similar to Go's and Ruby'sIO.select
.There are a couple of useful generic classes:
RingBuffer
a simple non-thread-safe ring buffer implementationBlockingRingBuffer
a blocking implementation based on the previous oneWaitableList
a blocking list (maybe it should be called BlockingQueue 😰 ) - at the moment is only an internal class, not meant to be exposed, but it could be improved and published as a part of our public APIIt has not been tested very much and lacks of documentation: I'm a but unsure if it should be merged today (to have it in 0.6.0-pre) or it's better wait a couple of days.