Skip to content

rpc: Tx projections #4

@MikailBag

Description

@MikailBag

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions