/// Write an event without routing key.
///
/// A random routing key will be generated in this case.
///
/// This method sends the payload to a background task called reactor to process,
/// so the success of this method only means the payload has been sent to the reactor.
/// Applications may want to call await on the returned tokio oneshot to check whether
/// the payload is successfully persisted or not.
/// If oneshot returns an error indicating something is going wrong on the server side, then
/// subsequent calls are also likely to fail.
///
/// # Examples
///
/// ```ignore
/// let mut event_writer = client_factory.create_event_writer(stream);
/// // result is a tokio oneshot
/// let result = event_writer.write_event(payload).await;
/// result.await.expect("flush to server");
/// ```
Write an event without routing key.
A random routing key will be generated in this case.

This method sends the payload to a background task called reactor to process,
so the success of this method only means the payload has been sent to the reactor.
Applications may want to call await on the returned tokio oneshot to check whether
the payload is successfully persisted or not.
If oneshot returns an error indicating something is going wrong on the server side, then
subsequent calls are also likely to fail.
Write an event without routing key . A random routing key will be generated in this case . This method sends the payload to a background task called reactor to process so the success of this method only means the payload has been sent to the reactor . Applications may want to call await on the returned tokio oneshot to check whether the payload is successfully persisted or not . If oneshot returns an error indicating something is going wrong on the server side then subsequent calls are also likely to fail .
pub async fn write_event(&mut self, event: Vec<u8>) -> oneshot::Receiver<Result<(), Error>> {
        let size = event.len();
        let (tx, rx) = oneshot::channel();
        let routing_info = RoutingInfo::RoutingKey(None);
        if let Some(pending_event) = PendingEvent::with_header(routing_info, event, None, tx) {
            let append_event = Incoming::AppendEvent(pending_event);
            self.writer_event_internal(append_event, size, rx).await
        } else {
            rx
        }
    }
pub async fn write_event ( & mut self , event : Vec < u8 > ) -> oneshot :: Receiver < Result < ( ) , Error > > { let size = event . len ( ) ; let ( tx , rx ) = oneshot :: channel ( ) ; let routing_info = RoutingInfo :: RoutingKey ( None ) ; if let Some ( pending_event ) = PendingEvent :: with_header ( routing_info , event , None , tx ) { let append_event = Incoming :: AppendEvent ( pending_event ) ; self . writer_event_internal ( append_event , size , rx ) . await } else { rx } }
Write an event without routing key.
Write an event without routing key .
&mut self
event
Vec<u8>
examples
```ignore
let mut event_writer = client_factory.create_event_writer(stream);
result is a tokio oneshot
let result = event_writer.write_event(payload).await;
result.await.expect("flush to server");
```
` ` ` ignore let mut event_writer = client_factory . create_event_writer ( stream ) ; result is a tokio oneshot let result = event_writer . write_event ( payload ) . await ; result . await . expect ( " flush to server " ) ; ` ` `