Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gocsp-channel

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gocsp-channel

## Example

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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() // => 10
    yield ch_1.take() // => 20

})()

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) // print 10
channel.put(20) // print 20
channel.put(30) // print 30

Alias: channel.forEach

channel.close()

Example:

channel.close()
channel.close(new Error()) // close with error

channel.done( callback )

Example:

FAQs

Package last updated on 31 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc