Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot implement custom async runtime #1858

Closed
TaeHagen opened this issue Apr 5, 2024 · 5 comments · Fixed by #1865
Closed

Cannot implement custom async runtime #1858

TaeHagen opened this issue Apr 5, 2024 · 5 comments · Fixed by #1865
Labels
bug Something isn't working

Comments

@TaeHagen
Copy link

TaeHagen commented Apr 5, 2024

Describe the bug

According to the docs, in v2 you should be able to implement your own BaseAsyncRuntime. However, I created a struct that implements it, but it is never called. I think I need to declare a new executor, but there appears to be no way to access all the types I need to do that because many of them are not exported. How can I provide a custom async runtime? I need to manage it's lifecycle outside of the context of this project for background work when the dart VM is not active.

Thank you!

Steps to reproduce

Hint: A simple way to reproduce is to clone and modify the https://github.com/fzyzcjy/flutter_rust_bridge/tree/master/frb_example/dart_minimal example package according to your needs.

  1. ...
  2. ...
  3. ...

Logs

None applicable

Expected behavior

No response

Generated binding code

No response

OS

No response

Version of flutter_rust_bridge_codegen

2.0

Flutter info

No response

Version of clang++

No response

Additional context

No response

@TaeHagen TaeHagen added the bug Something isn't working label Apr 5, 2024
Copy link

welcome bot commented Apr 5, 2024

Hi! Thanks for opening your first issue here! 😄

@fzyzcjy
Copy link
Owner

fzyzcjy commented Apr 6, 2024

I think I need to declare a new executor, but there appears to be no way to access all the types I need to do that because many of them are not exported

Hmm then that looks like a bug! Feel free to PR to fix it (export needed variables), or alternatively I will fix it in the (hopefully within a week) next batch.

P.S. #1848 is also working on async runtime

@TaeHagen
Copy link
Author

TaeHagen commented Apr 6, 2024

Could I instead change the DefaultExecutor type to have another type parameter, one for the async runtime?

@fzyzcjy
Copy link
Owner

fzyzcjy commented Apr 6, 2024

Sure, you are free to use whatever executor you like.

Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
2 participants