mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Until we implement #3959 for the Apple client, we need to be careful around how we de-initialise the Rust session. Callback-based designs are difficult to get right across boundaries because they enable re-entrances which then lead to runtime errors. Specifically, freeing the session needs to cleanup the tokio runtime but that is impossible if the callback is still executed from that exact runtime. To workaround this, we need to free the session pointer from a new task. Moving to #3959 will solve this in a much more intuitive way because we can ditch the callbacks and instead move to a stream of events that the host app can consume. --------- Signed-off-by: Thomas Eizinger <thomas@eizinger.io>