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 to IpcReceiver that wraps the ROUTER integration #265

Open
jdm opened this issue May 1, 2020 · 0 comments
Open

Add API to IpcReceiver that wraps the ROUTER integration #265

jdm opened this issue May 1, 2020 · 0 comments

Comments

@jdm
Copy link
Member

jdm commented May 1, 2020

When I have a recv: IpcReceiver<T>, writing code like this feels like boilerplate:

        ROUTER.add_route(
            recv.to_opaque(),
            Box::new(move |msg| {
                do_something(
                    msg.to()
                        .expect("deserialization failed"),
                );
            }),
        );

I would rather write something like recv.on_receive(Box::new(|msg| do_something(msg))), which does all of the opaque conversions for me and adds a route to the router.

@jdm jdm added the enhancement label May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant