Skip to content

Commit

Permalink
Update code to modify result in worker
Browse files Browse the repository at this point in the history
  • Loading branch information
poorna2152 committed May 29, 2024
1 parent 7e0cf43 commit 986c791
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions examples/multiple-receive/multiple_receive.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public function main() {
3 -> w3;
}

worker w3 returns Result {
worker w3 returns json {
// The worker waits until both values are received.
Result result = <- {a: w1, b: w2};
return result;
return result.toJson();
}

Result result = wait w3;
json result = wait w3;
io:println(result);
}
2 changes: 1 addition & 1 deletion examples/multiple-receive/multiple_receive.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Multiple receive

The multiple receive action can be used to receive values from multiple send actions. It operates by awaiting the receipt of values from all the send actions, subsequently constructing a map containing those values.
The multiple receive action can be used to receive values corresponding to multiple send actions. It operates by waiting for the receipt of values from all the send actions, subsequently constructing a mapping value containing those values.

::: code multiple_receive.bal :::

Expand Down

0 comments on commit 986c791

Please sign in to comment.