Channels for CSP style Ruby
Find a file
2015-08-03 13:50:17 +02:00
examples examples 2015-08-03 13:50:05 +02:00
lib waitgroup 2015-08-03 13:49:49 +02:00
test waitgroup 2015-08-03 13:49:49 +02:00
.gitignore first commit 2015-08-03 13:49:35 +02:00
.rubocop.yml first commit 2015-08-03 13:49:35 +02:00
.travis.yml first commit 2015-08-03 13:49:35 +02:00
channel.gemspec first commit 2015-08-03 13:49:35 +02:00
Gemfile first commit 2015-08-03 13:49:35 +02:00
Gemfile.lock first commit 2015-08-03 13:49:35 +02:00
Rakefile first commit 2015-08-03 13:49:35 +02:00
README.md readme 2015-08-03 13:50:17 +02: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.

License

MIT