Project

normandy

0.0
No commit activity in last 3 years
No release in over 3 years
Share memory by communicating
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

Channels for ruby

A complete implementation of channels for Ruby, including size and close.

How?

The usual gem insall channel, or gem channel in your Gemfile.

require 'channel'

c = Channel.new
go -> { c << 'Hello, world!' }
puts c.recv

Why?

While some packages already exist, many fail at providing a thorough implementation, often limited to send/recv, and most critically, all missing close support. A complete implementation makes channels much more useful, as most patterns rely much more details than simply send/recv.

To prove this point and to serve as a nice tutorial anyway, some examples ported over from Go by example are included in examples.

  • channels
  • channel buffering
  • channel synchronization
  • channel direction
  • select
  • timeouts
  • non-block channel operations
  • closing channels
  • range over channels

License

MIT