kebab
Half queue half pubsub. Super small (< 30 loc) and simple queue that supports subscribers.
Last updated 8 years ago by thlorenz .
BSD · Repository · Original npm · Tarball · package.json
$ cnpm install kebab 
SYNC missed versions from official npm registry.

kebab Build Status

Half queue half pubsub. Super small and simple queue that supports subscribers.

Installation

npm install kebab

API

create a kebab

var kebab = require('kebab')
  , kb = kebab();

enqueue

kebab.enqueue(item)

item is what ever you want to pass when a subscriber callback is called.

Example:

kb.enqueue('hello world');

once

kebab.once(callback)

subscribe to a queued item. If one is currently available, callback will be invoked with it immediately.

Otherwise the callback will be invoked one time when an item is enqueued in the future.

Example:

kb.once(function (arg) { console.log('working on ', arg); });

Current Tags

  • 0.0.3                                ...           latest (8 years ago)

4 Versions

  • 0.0.3                                ...           8 years ago
  • 0.0.2                                ...           8 years ago
  • 0.0.1                                ...           8 years ago
  • 0.0.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |