Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

Cumulo/pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cumulo Pipeline

EventStream Pipeline for Cumulo Apps

Usage

npm i --save cumulo-pipeline
Pipeline = require 'cumulo-pipeline'

p1 = new Pipeline
p2 = new Pipeline
p1.forward p2

p2.for (x) -> console.log 'got event', x

p1.send 'event'

See test.cirru for more:

var
  Pipeline $ require :./src/pipeline

var
  p1 $ new Pipeline
  p2 $ new Pipeline

p1.forward p2
p2.for $ \ (x)
  console.log :event x

var p3 $ p1.map $ \ (x)
  return $ + ":::" x

p3.for $ \ (x)
  console.log x

p1.send :x

var p4 $ p1.reduce 0 $ \ (a b) $ return $ + a b

p4.for $ \ (x)
  console.log x

var data $ [] 1 2 3 4 5
data.forEach $ \ (x) (p1.send x)

Methods

send and for are from Go syntax.

  • send send data into pipes
  • for get data from pipes
  • forward send data to next pipe
  • map map events into a new pipe
  • reduce reduce events into a new pipe

License

MIT

About

EventStream Pipeline for Cumulo Apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages