Page MenuHomePhabricator

[Tunnelbroker] Encapsulate message handling with Session object
ClosedPublic

Authored by jon on May 9 2023, 11:57 PM.
Tags
None
Referenced Files
F2896111: D7768.id.diff
Fri, Oct 4, 7:20 PM
Unknown Object (File)
Fri, Oct 4, 5:39 PM
Unknown Object (File)
Fri, Oct 4, 3:43 PM
Unknown Object (File)
Sun, Sep 29, 11:17 AM
Unknown Object (File)
Sun, Sep 29, 11:17 AM
Unknown Object (File)
Sun, Sep 29, 11:17 AM
Unknown Object (File)
Sun, Sep 29, 11:17 AM
Unknown Object (File)
Sun, Sep 29, 11:13 AM
Subscribers

Details

Summary

It's convenient to hold on to information about the
connected device in some way. This is a minor refactor to
move that context into it's own object.

Part of: https://linear.app/comm/issue/ENG-3822

Test Plan
nix develop

(cd services/tunnelbroker && RUST_LOG=debug cargo run &)
cd services/commtest && cargo test --test tunnelbroker_integration_test

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek added inline comments.
services/tunnelbroker/src/websockets/session.rs
7

Nit: Is there a reason why you have a fully qualified name here? Can't we e.g. use tokio::sync::mpsc; and then call it mpsc::UnboundedSender?
Also I think you can just use String

This revision is now accepted and ready to land.May 10 2023, 1:19 AM
jon added inline comments.
services/tunnelbroker/src/websockets/session.rs
7

Think I just copied the signature from an error output, but you're right. Should make this more human-readable.

7

Tackled this in D7800, when I polished a lot of this session code.

jon marked an inline comment as done.

Rebase on master