0.0.5 • Published 6 years ago

@joduplessis/keg v0.0.5

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

Keg

Keg is a messaging queue. It's not suitable for production yet. Expect things to break & change without notice. It includes TypeScript support.

Installation

npm i @joduplessis/keg

Terminology

It's helpful to think in these terms:

  • Keg: overall queue ID
  • Tap: outlet of messages received, identified by an ID
  • Spike: a reduce orientated middleware for messages
  • Refill: adds a new message to a keg:tap
  • pour(): something like a next() to move through the queue

Some example usage:

Keg.keg('kegger').tap('demo', async (val, pour) => {
  // 'val' is the current value for the demo queue
  // We can process it here
  // And then move onto the next item in the queue
  // Equivalent to next()
  pour()
}, () => {
  // Tap is empty
})

// Add middleware to each message
Keg.keg('kegger').spike('demo', in => {
  return window.btoa(in)
})

Keg.keg('kegger').refill('demo', 'Some text')
Keg.keg('kegger').refill('demo', { order: 'Object message types' })
Keg.keg('kegger').refill('demo', 42)

Spiking your drink

Any middleware that gets added will act as a pipe. It take the value in & passes it onto the next spike().

Roadmap

  • Get base library set up
  • Choose a nifty logo
  • Add support for multiple kegs
  • Add tests
  • Package for NPM
  • Add support for external pub/subs
0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.0

6 years ago

0.0.1

6 years ago