From 986c791a793810ea6861ddd2d28ab7e7a27eb998 Mon Sep 17 00:00:00 2001 From: poorna2152 Date: Thu, 18 Apr 2024 12:04:52 +0530 Subject: [PATCH] Update code to modify result in worker --- examples/multiple-receive/multiple_receive.bal | 6 +++--- examples/multiple-receive/multiple_receive.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/multiple-receive/multiple_receive.bal b/examples/multiple-receive/multiple_receive.bal index b163ae9c77..60272d287d 100644 --- a/examples/multiple-receive/multiple_receive.bal +++ b/examples/multiple-receive/multiple_receive.bal @@ -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); } diff --git a/examples/multiple-receive/multiple_receive.md b/examples/multiple-receive/multiple_receive.md index 7127e80fca..62a824eb3b 100644 --- a/examples/multiple-receive/multiple_receive.md +++ b/examples/multiple-receive/multiple_receive.md @@ -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 :::