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

[ffigen] Use one NativeCallable.listener for all listener blocks #1760

Closed
liamappelbe opened this issue Nov 27, 2024 · 1 comment
Closed
Assignees
Labels
lang-objective_c Related to Objective C support package:ffigen

Comments

@liamappelbe
Copy link
Contributor

Atm we have one NativeCallable.listener per block signature. Each NativeCallable.listener has its own receive port. This means that two callbacks with different signatures can be called in a different order to the order that the native thread called them in. This can cause problems, especially for protocol implementers.

To fix this we can use a single NativeCallable.listener for all blocks in the isolate. The downside of this is it'll involve dynamic dispatch, which is slightly inefficient. But I think that's negligible in this async case.

dart-lang/http#1413

@liamappelbe
Copy link
Contributor Author

The messages arrive in order even when the block signatures are different (#1781), so using a single listener won't help. Gonna work on this approach instead: #1647

@github-project-automation github-project-automation bot moved this from Todo to Done in ObjC/Swift interop Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-objective_c Related to Objective C support package:ffigen
Projects
Status: Done
Development

No branches or pull requests

1 participant