Not sure how can I call my code within a non-suspe...
# coroutines
m
Not sure how can I call my code within a non-suspend function and still return it. Here I am adding the
Copy code
renderMetricTimer.tagVal(renderTemplate.mediaType.name).time {
but clearly it gives the error
suspend function needs to be call in a subroutine.
This function returns a value (
map
). Not sure how can I do this.
z
If you want to be able to call
time
from both suspend and non-suspend functions (which I'm not 100% sure is what you're asking, but…), make your
time
function inline. Also just generally good practice for higher-order functions like this one that just wrap code in a try/catch.