task_send(t, msg)
Sends the message msg
asynchronously to the task t
. Return void
.
Message sending is also achieved with the !>
operator which has the syntax:
t !> msg
Unlike the task_send
function the !>
operator returns the message that was sent.
function add2()
letseq (sender:n = task_receive())
task_send(sender, n + 2)
let adder = task(add2)
adder !> self():10
// <task>:10
task_receive()
// 12