Skip to content

Add SubscribeEvents to enable user notifications - #186

Merged
rlahfa-dinum merged 11 commits into
mainfrom
user-notifications
Sep 7, 2026
Merged

rlahfa-dinum merged 11 commits into
mainfrom
user-notifications

Conversation

@rlahfa-dinum

Copy link
Copy Markdown
Collaborator

This adds the infrastructure to broadcast events inside the program and let someone subscribe via RPC.
Additionally, Portail gains i18n features to support translation of user-facing messages.

I only added one emit for now, but I will add more in this PR: SOCKS5 & pre-handshake. HTTP CONNECT will use the future error pages mechanism rather.

Signed-off-by: Ryan Lahfa ryan.lahfa.ext@numerique.gouv.fr

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
Comment thread src/rpc/fr_gouv_portail_control.rs Outdated

@agrimault-dinum agrimault-dinum left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, you already pointed out the unimplemented event fields

SubscribeEvents is a stream, therefore, it uses the `more` annotation.

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
We use a bus with 2048 events, this is certainly well enough.

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
Useful for debugging and small scripting.

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
RPC subsystems now also use the Arc<ProxyRuntime> pointer, this avoids
locking the state needlessly as the broadcaster is itself properly
protected.

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
We also use tr! to translate the strings in the future.

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
This adds a very simple setup for i18n using the tr crate and
include-po.

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
The project has grown complicated enough so that nix-shell -p doesn't
cut it anymore.

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
@rlahfa-dinum
rlahfa-dinum merged commit ea22930 into main Sep 7, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants