You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Sorry for if the question is too newbie but is it ok to call functions from a tokio context? like below (tx is streamingcallsink and rx is Clientcstreamreceiver)
It's unsafe to mix using different runtime. The problem is that tokio expects using its own executor for their futures. You should not spawn futures calling tokio functions into grpcio by client.spawn or ctx.spawn.
Activity
BusyJay commentedon Mar 30, 2021
Yes, it's OK to do so.
capacman commentedon Mar 30, 2021
Thank you. When i read other issues ,it confuse me a little bit. So what is the problem described in #338
BusyJay commentedon Mar 30, 2021
It's unsafe to mix using different runtime. The problem is that tokio expects using its own executor for their futures. You should not spawn futures calling tokio functions into grpcio by
client.spawnorctx.spawn.BusyJay commentedon Mar 30, 2021
It's best to bridge them by using some channels and spawn the futures generated by grpcio into grpcio reactor for best performance.