Add the following code to your project's shard.yml under:
to use in production
- OR -
development_dependencies to use in development
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.
Add the dependency to your
dependencies: mpsc: github: jgaskins/mpsc
require "mpsc" channel = MPSC::Channel(String).new spawn channel.send "hello" channel.receive # "hello"
git checkout -b my-new-feature)
crystal tool format .)
git commit -am 'Add some feature')
git push origin my-new-feature)