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

Multiplexing backend adapter #79

Open
plaidfinch opened this issue Mar 25, 2021 · 0 comments
Open

Multiplexing backend adapter #79

plaidfinch opened this issue Mar 25, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@plaidfinch
Copy link
Contributor

It may be desirable to convert a 1:1 "physical" connection on some backend into a set of N:N "logical" connections, each of which behaves as its own separate channel.

Proposal: two complementary wrappers around a pair of Tx/Rx that provides methods analogous to TCP. One wrapper, Acceptor, provides an accept method that awaits new connections; the other, Connector, provides a connect method that creates a new connection by generating a unique (at least, non-temporally-overlapping-on-this-connection) id and sends it. Ids could be generated by a Slab<()> or by the memory address of some pinned value that lasts the lifetime of the logical connection.

Use of the transmitter and receiver must be synchronized using one async mutex each, to ensure messages are fully sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant