Closed Jhonfunk closed 1 month ago
Hi, what about this:
pub fn func(sink: StreamSink<String>) {
(FLUTTER_RUST_BRIDGE_HANDLER.thread_pool()).execute(transfer!(|| {
... your long executing code here ...
}));
}
Alternatively, you can spawn a thread by whatever other approaches you like.
I don't have issues with StreamSink but agree with @fzyzcjy solution. I think that the right approach is that an application should always be asynchronous/multithreaded and should not block waiting for a response.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
After #1867, StreamSink does not return until the rust function has finished. So how about those streams that need to last a long time?