mpsc
Version, currently master branch1 version
- master branchlatestNov 28, 2021
github.com/jgaskins/mpsc
Multi-Producer/Single-Consumer channels in Crystal
Installation
# Add this to your shard.yml
dependencies:
mpsc:
github: jgaskins/mpsc
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 0.36.1, < 2.0.0- License
- MIT
- Author
- Jamie Gaskins
Dependencies
This version declares no dependencies.
README
mpsc
MPSC is an implementation of a multi-producer/single-consumer channel. This is useful if you only ever consume a channel from within a single fiber.
MPSC channels are unbounded. Calling send will never block.
Note: This shard is not suitable for consuming the same channel from multiple fibers, even if they don't consume it concurrently. Once you call receive from a fiber, the receiving end of the channel is locked to that fiber.
Installation
-
Add the dependency to your
shard.yml:dependencies: mpsc: github: jgaskins/mpsc -
Run
shards install
Usage
require "mpsc"
channel = MPSC::Channel(String).new
spawn channel.send "hello"
channel.receive # "hello"
Contributing
- Fork it (https://github.com/jgaskins/mpsc/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Reformat the code (
crystal tool format .) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Jamie Gaskins - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Nov 28, 2021
- Crystal
>= 0.36.1, < 2.0.0- Indexed
- yes
Dependents
Repository
github.com/jgaskins/mpsc
Metadata
- Created
- Aug 12, 2026
- Updated
- Nov 8, 2026
- Synced
- Nov 8, 2026
- Versions
- 1