Channels for CSP style Ruby
Find a file
2016-02-14 17:03:33 +01:00
examples bumping rubocop 2016-02-14 16:44:33 +01:00
lib name the damn thing 2016-02-14 16:59:21 +01:00
test bumping rubocop 2016-02-14 16:44:33 +01:00
.gitignore WIP 2015-12-15 13:50:47 +01:00
.rubocop.yml bumping rubocop 2016-02-14 16:44:33 +01:00
.travis.yml first commit 2015-08-03 13:49:35 +02:00
Gemfile first commit 2015-08-03 13:49:35 +02:00
Gemfile.lock fix gemspec glob 2016-02-14 17:03:33 +01:00
normandy.gemspec fix gemspec glob 2016-02-14 17:03:33 +01:00
Rakefile first commit 2015-08-03 13:49:35 +02:00
README.md WIP 2015-12-15 13:50:47 +01:00

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