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

connlib: re-design API between clients & tunnel #4452

Closed
1 of 2 tasks
thomaseizinger opened this issue Apr 1, 2024 · 1 comment
Closed
1 of 2 tasks

connlib: re-design API between clients & tunnel #4452

thomaseizinger opened this issue Apr 1, 2024 · 1 comment
Labels
area/connlib Firezone's core connectivity library kind/refactor Code refactoring

Comments

@thomaseizinger
Copy link
Member

thomaseizinger commented Apr 1, 2024

This is a tracking issue that is meant to capture some ideas for re-designing how we communicate from the Tunnel with the individual clients. Currently, this done via callbacks in two places:

  1. From within the Tunnel to the various "glue" crates for the clients
  2. Across the FFI boundary (only Android and Apple)

Tasks

  1. area/connlib kind/refactor

The goal is to free connlib from as much platform-specific code as possible. This allows Tun to be a Sink + Stream of IpPackets and all the platform-specific stuff is in the already platform-specific client crates.

Emitting a stream of events changes from a push to a pull design, giving clients more flexibility in handling them by e.g. having access to &mut self, async etc.

We might be able to remove the callbacks across the FFI boundary with a move to UniFFI (#3959) which supports async functions. That would allow Android as well as Swift to use their native co-routine / tasks mechanism to directly respond to the next emitted event and handle it accordingly.

@thomaseizinger thomaseizinger added kind/refactor Code refactoring area/connlib Firezone's core connectivity library labels Apr 1, 2024
@thomaseizinger
Copy link
Member Author

Closing because it duplicates what is now in other issues.

@thomaseizinger thomaseizinger closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connlib Firezone's core connectivity library kind/refactor Code refactoring
Projects
None yet
Development

No branches or pull requests

1 participant