2020-06-12 10:22:08 -07:00
|
|
|
use tokio::sync::oneshot;
|
|
|
|
|
2020-06-12 11:42:28 -07:00
|
|
|
/// Message sent to the batch worker
|
2020-06-12 10:22:08 -07:00
|
|
|
#[derive(Debug)]
|
2020-06-17 14:39:10 -07:00
|
|
|
pub(crate) struct Message<Request, Fut, E> {
|
2020-06-12 10:22:08 -07:00
|
|
|
pub(crate) request: Request,
|
2020-06-17 14:39:10 -07:00
|
|
|
pub(crate) tx: Tx<Fut, E>,
|
2020-06-12 10:22:08 -07:00
|
|
|
pub(crate) span: tracing::Span,
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Response sender
|
2020-06-17 14:39:10 -07:00
|
|
|
pub(crate) type Tx<Fut, E> = oneshot::Sender<Result<Fut, E>>;
|
2020-06-12 10:22:08 -07:00
|
|
|
|
|
|
|
/// Response receiver
|
2020-06-17 14:39:10 -07:00
|
|
|
pub(crate) type Rx<Fut, E> = oneshot::Receiver<Result<Fut, E>>;
|