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

Make Runtimes Generic #712

Closed
17 of 18 tasks
paulgb opened this issue May 4, 2024 · 0 comments
Closed
17 of 18 tasks

Make Runtimes Generic #712

paulgb opened this issue May 4, 2024 · 0 comments

Comments

@paulgb
Copy link
Member

paulgb commented May 4, 2024

@paulgb paulgb changed the title Make Executors Generic Make Runtimes Generic May 7, 2024
michaelsilver added a commit that referenced this issue Jun 18, 2024
As part of our efforts to support executors that run in a separate
process (see #712), introduce a
library for communication over unix domain sockets.

I wrote this library because I could not find any mature Rust library
for sending typed messages over unix sockets. Luckily, most of the
"heavy lifting" is done by stitching together existing mature libraries
in the ecosystem.

The goals of this library were to support:
* Typed messages of any length, so long as they are serializable by
`serde` (for this reason we chose streaming sockets over datagram
sockets)
* Newline-delimited JSON as the wire protocol (for easy interop with
other languages)
* Async code (and thus concurrent message sending/receiving) 
* The specific usecase of request/response messaging
* Ad-hoc messages client to server, or server to client
* Safe client or server restarts

Non goals of this library:
* Multiple clients connecting to a server
* High message throughput
* Unreliable transport over unix sockets (["as on most UNIX
implementations, UNIX domain datagram sockets are always
reliable"](https://man7.org/linux/man-pages/man7/unix.7.html))

This was a fun project -- unix streaming sockets simply send binary over
the wire and are very low level primitive, so achieving correct
concurrency control and typing was nontrivial! Chapter 57 of _The Linux
Programming Interface_ is a good brief primer on unix sockets for anyone
unfamiliar.

---------

Co-authored-by: Paul Butler <[email protected]>
@paulgb paulgb closed this as completed Sep 3, 2024
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

No branches or pull requests

1 participant