NOTE that in cloud some of these fail because of built-in delays. So diesel.isLocalhost
send::
msg test.diesel.cluster.sendspawnremote
val x:Array=([1 .. 10] map x=>test.diesel.cluster.sendspawnremote(x)())
time
send::
msg diesel.cron.cancel (name="clusterSingleton1"
)
send::
msg diesel.cron.set (name="clusterSingleton1"
, time, schedule="1s"
, singleton="yes"
, cronMsg="$msg ctx.log()"
, count:Number=1
)
Wait for it to kick before continuing - it will also dissapear:
send::
msg ctx.sleep (duration:Number=2500
)
send::
msg diesel.cron.list
expect:: ( (sizeOf(payload) is 0)
)$ifc:: diesel[="isLocalhost"]
send::
msg diesel.cron.cancel (name="clustercron1"
)
This will start in 1 sec and tick every 1 sec for at most 2 occurences (counts)
send::
msg diesel.cron.set (name="clustercron1"
, schedule="1s"
, time, singleton="yes"
, collect:Number=5
, cronMsg="$msg ctx.log()"
, count:Number=2
)
send::
msg diesel.cron.list
expect:: ( (sizeOf(payload) is 1)
)$ifc:: diesel[="isLocalhost"]
expect:: ( ((payload as string) contains "clustercron1")
)
send::
msg diesel.cron.cancel (name="clustercron1"
)
send::
msg diesel.cron.list
expect:: ( (sizeOf(payload) is 0)
)$ifc:: diesel[="isLocalhost"]
expect:: NOT ( ((payload as string) contains "clustercron1")
)
send::
msg diesel.stream.new (stream="stest95"
, timeoutMillis:Number=100000
)
val stest95=dieselStream
val stest95ref=dieselStreamRef
send::
msg testdiesel.please.streamremoteputdone (streamRef)
send::
msg diesel.stream.consume (stream="stest95"
)
You need to log in to post a comment!