diff --git a/examples/alternate-receive/alternate_receive.bal b/examples/alternate-receive/alternate_receive.bal index 009d7c2fdb..d5f14e8b2e 100644 --- a/examples/alternate-receive/alternate_receive.bal +++ b/examples/alternate-receive/alternate_receive.bal @@ -33,8 +33,7 @@ public function main() { worker w6 returns int|error? { // Alternate receive action waits until a message that is not an error is received. - // Since `w4` returns an error, it waits further and - // sets the value that is received from `w5`. + // Since `w4` returns an error, it waits further and sets the value that is received from `w5`. int a = check <- w4 | w5; return a; } diff --git a/examples/alternate-receive/alternate_receive.md b/examples/alternate-receive/alternate_receive.md index 89487bae81..e9959a73a4 100644 --- a/examples/alternate-receive/alternate_receive.md +++ b/examples/alternate-receive/alternate_receive.md @@ -1,6 +1,6 @@ # Alternate receive -The alternate receive action can be used receive values from several workers. It waits until either a non-error message, a panic termination status on a closed channel, or closure of all channels. Alternate receive actions sets the first non-error value it encounters as the result. +The alternate receive action can be used to receive values from several workers. It operates by waiting until it encounters a non-error message, a panic termination status on a closed channel, or the closure of all channels. Alternate receive action sets the first non-error value it encounters as the outcome. ::: code alternate_receive.bal ::: diff --git a/examples/index.json b/examples/index.json index ab96861533..e01c874bcc 100644 --- a/examples/index.json +++ b/examples/index.json @@ -1440,6 +1440,13 @@ "verifyOutput": true, "isLearnByExample": true }, + { + "name": "Alternate receive", + "url": "alternate-receive", + "verifyBuild": true, + "verifyOutput": true, + "isLearnByExample": true + }, { "name": "Inter-worker failure propagation", "url": "inter-worker-failure-propagation", @@ -1467,13 +1474,6 @@ "verifyBuild": true, "verifyOutput": true, "isLearnByExample": true - }, - { - "name": "Alternate receive", - "url": "alternate-receive", - "verifyBuild": true, - "verifyOutput": true, - "isLearnByExample": true } ] },