I have read Non-blocking version of Gosub command as an effort to implement a non-blocking Gosub()
(or rather a context that returns right away but continues processing a long-running task in the background).
I generally understand the concept of Local channels in the Dial()
command and already have scratched the surface in using it.
But in this case, the context I want to run in the background (which would be the target of a Local/
channel) takes an argument and I cannot see how Dial()
can pass an argument.
Generally I’m thinking of the non-blocking-long-running context to look like this:
context send_message_non_blocking {
s => {
NoOp(Message: ${ARG1});
Dial(Local/s@noop&Local/s@send_message);
}
};
context noop {
NoOp(Doing nothing in noop);
return;
};
context send_message {
s => {
NoOp(Sending a Message...);
NoOp(This can take a long time);
NoOp(Message: ${ARG1});
...
return;
}
};
With goal being to be able to call Gosub(send_message_non_blocking,s,1(Message goes here))
and have it return immediately, without waiting for the long running send_admin_message
to finish.
Or is my approach above completely unworkable?