gocsp-channel
Example
var co = require('gocsp-co')
var Channel = require('gocsp-channel')
var ch_0 = new Channel()
var ch_1 = new Channel()
co(function* () {
yield ch_0.take()
yield ch_1.take()
})()
ch_0.put(10)
ch_1.put(20)
API
new Channel()
Example:
var Channel = require('gocsp-channel')
var chan = new Channel()
channel.take()
Example:
var chan = new (require('gocsp-channel'))()
chan.take()
channel.take( callback )
Example:
channel.put( value )
Example:
channel.put( value, callback )
Example:
channel.each( fn )
Example:
channel.each(console.log)
channel.put(10)
channel.put(20)
channel.put(30)
Alias: channel.forEach
channel.close()
Example:
channel.close()
channel.close(new Error())
channel.done( callback )
Example: