Skip to content
Discussion options

You must be logged in to vote

Simply use a mpsc::channel. The receiver end will be inside your event loop waiting for instructions. (probably inside a tokio::select!)
The transmitter you take wherever you want

I have a similar example: gistit-daemon
But I'm using unix sockets here, where you'd be using just a mpsc::channel

Another similar example: file-sharing

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mgrand
Comment options

@mxinden
Comment options

mxinden Feb 14, 2022
Collaborator

Answer selected by mgrand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants