Socket
Socket
Sign inDemoInstall

gocsp-go

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gocsp-go

goroutine / coroutine


Version published
Weekly downloads
1
Maintainers
1
Install size
32.3 kB
Created
Weekly downloads
 

Readme

Source

gocsp-go

goroutine / coroutine

Example

go(function* () {

    yield chan.take()
    yield chan.put()

    // kind of like select statement in golang
    yield select(s =>
        s(chan.take(), function (err, result) {
            if (result.done) {
                console.log('channel is closed')
            } else {
                console.log('take from channel: ' + result.value)
            }
        })
        ||
        s(chan.put(value), function (err, ok) {
            if (ok) {
                // put okk
            } else {
                // put operation failed
            }
        })
        ||
        s(timeout(1000), function () {
            console.log('timeout!!!')
        })
    )
})

API

go( generator / generatorFunction )

Example:


go.wrap( generatorFunction )

Wrap a generator function into a regular function that returns a gocsp-thunk.

Example:

License

MIT

FAQs

Last updated on 27 Nov 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc