Allow launch_on
with a Tokio Unix socket listener
#2933
Labels
request
Request for new functionality
What's missing?
Currently (v0.6 development), you can pass a Tokio
TcpListener
tolaunch_on
. However, you can’t do the same thing with aUnixListener
. Doing this would bring parity between Rocket’s internal support forunix:/path/to/whatever
–style addresses and whatlaunch_on
accepts.This would make it possible for external users (e.g., me) to use Rocket with systemd socket activation, where an already-bound socket is passed into the process. Note that this already works with TCP sockets—you can construct a
tokio::net::TcpListener
from the passed-in socket and provide it to Rocket.This is a continuation of #545 and #2485.
Ideal Solution
Unlike the
TcpListener
type, which is directly used from Tokio, there is a customUnixListener
struct which handles creation of the socket file, locking, etc.To this we add a
From<tokio::net::UnixListener
implementation which simply takes ownership of the Tokio listener, and make thepath
alsoOption
al (so we don’t try to remove it upon drop).Why can't this be implemented outside of Rocket?
There is no way to pass your own Unix socket into Rocket otherwise.
Are there workarounds usable today?
No response
Alternative Solutions
No response
Additional Context
No response
System Checks
The text was updated successfully, but these errors were encountered: