Token-passing continuations are designed to specify a partial order of message processing. The token '@' is used to group messages and assigns the execution order to each of them. For instance, the following example forces the standardOutput actor, a predefined system actor for output, to print out "Hello World":
standardOutput <- print("Hello ") @ standardOutput <- print("World"); |
standardOutput <- print("Hello "); standardOutput <- print("World"); |
// returnHello() is defined as the follows: // String returnHello() {return "Hello";} returnHello() @ standardOutput <- println(token); |
// combineStrings() is defined as follows: // String combineStrings(String str1, String str2) // {return str1+str2;} returnHello() @ combineStrings(token, " World") @ standardOutput <- println(token); |