summaryrefslogtreecommitdiff
path: root/promises.msc
blob: 039a064e3d027c810c975ed7c567f2b8cf6790de (plain)
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
msc {
    client [label="Client code"],
    stubs [label="RPC stub"],
    service1 [label="Service process 1"],
    service2 [label="Service process 2"];

    |||;

    client => stubs [label="call Service 1"],
           stubs => service1 [label="Call packet"];
    client << stubs [label="Promise A"];

    client => stubs [label="call Service 2"],
           stubs => service2 [label="Call packet"];
    client << stubs [label="Promise B"];

    client rbox client [label="Local processing"],
           stubs << service2 [label="Reply packet"];

    client => stubs [label="wait(Promise A)"];
    ...;
    stubs << service1 [label="Reply packet"],
          client << stubs [label="Results from Service 1"];

    client => stubs [label="wait(Promise B)"];
    client << stubs [label="Results from Service 2"];
}