I have a use case where I, in a http service endpoint, need to dispatch several tasks and then combine the responses. In the sample code below, I get the warning (provided as a comment) on the service resource.
service / on new http:Listener(9090) {
// Warning: concurrent calls will not be made to this method since the method is not an 'isolated' method(BCE20402)
resource function get names() returns string {
worker w returns string {
return ["John", "Ada", "Harry"].toString();
}
return wait w;
}
}
With simple code like this, I have managed to avoid the warning by using start hidden inside a foreach lambda, but then it turns up again when I try to include a http client call to another resource in the concurrent tasks.
So what does the warning mean in practice? How can I do what I need to do?