fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
https://fzyzcjy.github.io/flutter_rust_bridge/
MIT License
3.64k stars 256 forks source link

multiple isolates in flutter #1817

Closed ggslayer closed 2 weeks ago

ggslayer commented 2 months ago

Hi, when I create a new isolate in flutter, call rust api in the new isolate, the error report: "flutter_rust_bridge has not been initialized. Did you forget to call await RustLib.init();?".

So, I have two question:

  1. does RustLib.init must be called in every isolate?
  2. if multiple isolate, the rust lib will exists multiple instance or one instance shared by multiple isolate?

thank you

fzyzcjy commented 2 months ago

Hi, does this doc work for you: https://cjycode.com/flutter_rust_bridge/guides/miscellaneous/isolates

fzyzcjy commented 2 weeks ago

Close since this seems to be solved. Feel free to reopen if having any issues!

github-actions[bot] commented 3 days ago

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.