streams-spec Pub

Diesel streaming features

Start the stream value generators

$when:: testdiesel.streams.startGenerator (stream, howMany)
   testdiesel.streams.generate (stream, howMany)

$when:: testdiesel.streams.generate (stream, howMany)
   diesel.stream.put (stream, data:Number<-1)
   diesel.stream.put (stream, data:Number<-2)
   diesel.stream.put (stream, data:Number<-3)
   diesel.stream.putAll (stream, data:Array<-[4,5])
   diesel.stream.done (stream)

$when:: diesel.stream.onData (stream == "s1", data)
   ctx.echo (data<-data)
   . (total=(total + data))

$when:: diesel.stream.onDone (stream)
   ctx.echo (heh<-"done ${stream}")

$when:: diesel.stream.onDataSlice (stream == "s2", data)
   ctx.echo (data<-data)
   . (total=(total + data))

API based

$when:: testdiesel.stream.consume (stream)
   diesel.stream.consume (stream)

$when:: diesel.rest (path ~path "/putAllInS3")
   ctx.echo (data<-payload)
   diesel.stream.putAll (stream<-"s3", data<-payload)
   diesel.stream.done (stream<-"s3")


Was this useful?    

By: Razie | 2020-10-04 | Tags: spec , dsl


Viewed 15 times ( | Print ) this page.

You need to log in to post a comment!

© Copyright DieselApps, 2012-2020, all rights reserved.