Tue 27 Aug 00:14:56 CEST 2024

This commit is contained in:
sbosse 2024-08-27 00:16:16 +02:00
parent bf52ebc1c5
commit a367c55854

17
test/test-later.js Normal file
View File

@ -0,0 +1,17 @@
port(DIR.IP('http://localhost:10001'))
// collector task
later(1000, function () {
var tuples = inp(['SURVEY',_],true)||[];
log('Got '+tuples.length+' surveys');
if (tuples.length) {
csv.write('surveys.csv',_,pluck(tuples,1));
}
return true;
});
// test only
later(2000, function () {
out(['SURVEY',{from:'test',answer:'yes'}]);
out(['SURVEY',{from:'test',answer:'no'}]);
})
start()