Using server-side streaming RPC in tonic, is it safe to do heavy compute without spawn_blocking?
When doing server-side streaming in tonic, the generated async function is expected to return something which implements Stream
. If I construct my stream by taking a receiver and then calling .map(my_very_expensive_function)
on it, will my_very_expensive_function
run on a tokio worker thread? Or somewhere it’s safe to do blocking operations?