Update Sept 6, 2023: Asynchronous callbacks with void returns can now be done with NativeCallable.listener from Dart 3.1.
Update March 12, 2020: Asynchronous callbacks can be done through the native ports mechanism. See the samples in samples/ffi/async and corresponding c code. In the future we would like to add a more concise syntax that requires less boilerplate code.
An asynchronous callback can be invoked outside the parent isolate and schedules a microtask there.
Update Sept 6, 2023: Asynchronous callbacks with void returns can now be done with
NativeCallable.listenerfrom Dart 3.1.Update March 12, 2020: Asynchronous callbacks can be done through the native ports mechanism. See the samples in samples/ffi/async and corresponding c code. In the future we would like to add a more concise syntax that requires less boilerplate code.
An asynchronous callback can be invoked outside the parent isolate and schedules a microtask there.