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

Add API so allow for a select-like mechanism using the ROUTER #267

Open
gterzian opened this issue Jun 16, 2020 · 0 comments
Open

Add API so allow for a select-like mechanism using the ROUTER #267

gterzian opened this issue Jun 16, 2020 · 0 comments

Comments

@gterzian
Copy link
Member

I'm running into this at servo/servo#26906

Essentially I have a route, which needs to select on two channels. I do this currently simply by having the same IPC channel shared in two different places, one being actually in the same process.

So you end-up with a message struct like:

pub enum BodyChunkRequest {
    /// This is over IPC
    Chunk,
    /// Signal the stream is done.
    /// Signal the stream is done(sent from script to script).
    Done,
    /// Signal the stream has errored(sent from script to script).
    Error,
}

Note the "script to script" messages. So essentially, some messages are received over IPC, which is the "normal" use-case for the route, but then there are also a few signals that are received from a thread on the same process.

Come to think of it, this is really about being able to add a channel, probably a normal crossbeam channel, to send messages to the route from the same process where it has been setup.

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