#Is there a way to return an isolated variable from an isolated function?
1 messages · Page 1 of 1 (latest)
As indicated by the error message, you will have to use a lock statement when accessing an isolated variable. Moreover, the return statement will have to be updated so that the expression is an isolated expression (e.g., using .clone()).
lock {
return outputIso.clone();
}
For more details
- https://ballerina.io/learn/by-example/isolated-variables
- https://ballerina.io/learn/by-example/#concurrency-safety
- #1080767188799062036 message