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

rpc: Tx projections #4

Open
MikailBag opened this issue Aug 24, 2020 · 1 comment
Open

rpc: Tx projections #4

MikailBag opened this issue Aug 24, 2020 · 1 comment

Comments

@MikailBag
Copy link
Member

MikailBag commented Aug 24, 2020

StreamingTx should have a method like as_event, with roughly following API (trait bounds and errors omitted):

impl<E, F> StreamingTx<E, F> {
    pub fn as_event_sender(&mut self) -> EventSender<E, F>;
}

pub struct EventSender<'a, E>(&'a mut StreamingTx<E, F>);

impl<E> EventSender<E>{ 
    pub async fn send_event(&mut self, ev: E);
   // note - no `finish` method
}
@MikailBag
Copy link
Member Author

MikailBag commented Aug 24, 2020

Also, EventSender should not have F generic parameter.

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