Membrane is an opinionated crate that generates a Dart package from a Rust library. Extremely fast performance with strict typing and zero copy returns over the FFI boundary via bincode.
Apache License 2.0
89
stars
12
forks
source link
Add timeout functionality for async receive ports #6
While previous releases contained a call to timeout(Duration(milliseconds: 1000)) on the codegenerated ReceivePort the timeout did not actually throw an exception if it was reached due to the behavior of ReceivePort()..timeout(). This PR fixes that bug and makes timeouts configurable at the project level and also at the function level. Timeouts can now be customized (even on streams) by passing the timeout option to async_dart. Example:
While previous releases contained a call to
timeout(Duration(milliseconds: 1000))
on the codegenerated ReceivePort the timeout did not actually throw an exception if it was reached due to the behavior ofReceivePort()..timeout()
. This PR fixes that bug and makes timeouts configurable at the project level and also at the function level. Timeouts can now be customized (even on streams) by passing thetimeout
option toasync_dart
. Example: