$when::
diesel.rest (path ~path "/testdiesel/streamsample"
)
. (stream
="stream${diesel.engine.id}"
)
diesel.stream.new (stream)
testdiesel.streams.generate (stream, howMany:Number=5
=5, delay:Number=500
=500)
. (payload
=dieselStream
)
Start the stream value generators
$when::
testdiesel.streams.startGenerator (stream, howMany)
testdiesel.streams.generate (stream, howMany)
$when::
testdiesel.streams.generate (stream, howMany, delay?)
diesel.stream.put (stream, data:Number=1
=1)
$ifc:: (delay is defined) ctx.sleep (duration=delay)
diesel.stream.put (stream, data:Number=2
=2)
$ifc:: (delay is defined) ctx.sleep (duration=delay)
diesel.stream.put (stream, data:Number=3
=3)
$ifc:: (delay is defined) ctx.sleep (duration=delay)
diesel.stream.putAll (stream, data :Array=[..]
=[4,5])
diesel.stream.done (stream)
$when::
diesel.stream.onData (stream == "s1"
, data)
ctx.echo (total=total)
ctx.echo (data=data)
. (dieselScope[="total"]
=(total + data)
)
$when::
diesel.stream.onDone (stream)
ctx.echo (heh="done ${stream}"
="done ${st...)
$when::
diesel.stream.onDataSlice (stream == "s2"
, data)
ctx.echo (data=data)
. (dieselScope[="total"]
=(total + data)
)
separate flow to consume
$when::
testdiesel.stream.consume (stream)
diesel.stream.consume (stream)
separate flow to create
$when::
diesel.rest (path ~path "/putAllInS3"
)
ctx.echo (data=payload)
diesel.stream.putAll (stream="s3"
="s3", data=payload)
diesel.stream.done (stream="s3"
="s3")
$when::
testdiesel.streams.generate (stream, howMany)
diesel.stream.put (stream, data:Number=1
=1)
diesel.stream.put (stream, data:Number=2
=2)
$when::
testdiesel.crontick
. (dieselRealm[="testcron"]
=(dieselRealm[="testcron"] + 1)
)
ctx.echo (x=dieselReal..., y=diesel[="r...)
. (payload
="testcron = ${diesel.realm.props.testcron}"
)
$when::
testdiesel.crondone (name)
. (dieselRealm[="testcron"]
=(dieselRealm[="testcron"] + name)
)
ctx.echo (x=dieselReal..., y=diesel[="r...)
. (payload
="testcron = ${diesel.realm.props.testcron}"
)
$when::
testdiesel.crontickEX
. (dieselRealm[="testcronEX"]
=(dieselRealm[="testcronEX"] + 1)
)
ctx.echo (x=dieselReal..., y=diesel[="r...)
. (payload
="testcron = ${diesel.realm.props.testcronEX}"
)
You need to log in to post a comment!