-
Notifications
You must be signed in to change notification settings - Fork 29
/
gettime.yaml
40 lines (40 loc) · 924 Bytes
/
gettime.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: gettime
doc: |-
A demo machine that tries to obtain the time via an HTTP request.
patternsyntax: json
nodes:
start:
branching:
type: message
branches:
- pattern: |
{"get":"time"}
target: request
request:
action:
interpreter: ecmascript
source: |-
_.out({to: {mid: "HTTP"},
url:"http://time.jsontest.com/",
replyTo: {mid: _.props.mid}});
return {};
branching:
branches:
- target: listen
listen:
branching:
type: message
branches:
- pattern: |
{"request":{"url":"http://time.jsontest.com/"}, "body": "?body"}
target: report
report:
action:
interpreter: ecmascript
source: |-
var body = JSON.parse(_.bindings["?body"]);
_.out({time: body.time});
return {};
branching:
branches:
- target: start