pub fn new(service: T, max_items: usize, max_latency: std::time::Duration) -> Self
    where
        T: Send + 'static,
        T::Future: Send,
        T::Error: Send + Sync,
        Request: Send + 'static,
    {
        let (batch, worker) = Self::pair(service, max_items, max_latency);
        tokio::spawn(worker.run());
        batch
    }
/// Creates a new `Batch` wrapping `service`.
///
/// The wrapper is responsible for telling the inner service when to flush a
/// batch of requests.  Two parameters control this policy:
///
/// * `max_items` gives the maximum number of items per batch.
/// * `max_latency` gives the maximum latency for a batch item.
///
/// The default Tokio executor is used to run the given service, which means
/// that this method must be called while on the Tokio runtime.
Creates a new `Batch` wrapping `service`.
The wrapper is responsible for telling the inner service when to flush a
batch of requests.  Two parameters control this policy.

`max_items` gives the maximum number of items per batch.
`max_latency` gives the maximum latency for a batch item.

The default Tokio executor is used to run the given service, which means
that this method must be called while on the Tokio runtime.
Creates a new ` Batch ` wrapping ` service ` . The wrapper is responsible for telling the inner service when to flush a batch of requests . Two parameters control this policy . ` max_items ` gives the maximum number of items per batch . ` max_latency ` gives the maximum latency for a batch item . The default Tokio executor is used to run the given service which means that this method must be called while on the Tokio runtime .
pub fn new(service: T, max_items: usize, max_latency: std::time::Duration) -> Self
    where
        T: Send + 'static,
        T::Future: Send,
        T::Error: Send + Sync,
        Request: Send + 'static,
    {
        let (batch, worker) = Self::pair(service, max_items, max_latency);
        tokio::spawn(worker.run());
        batch
    }
pub fn new ( service : T , max_items : usize , max_latency : std :: time :: Duration ) -> Self where T : Send + ' static , T :: Future : Send , T :: Error : Send + Sync , Request : Send + ' static , { let ( batch , worker ) = Self :: pair ( service , max_items , max_latency ) ; tokio :: spawn ( worker . run ( ) ) ; batch }
Creates a new `Batch` wrapping `service`.
Creates a new ` Batch ` wrapping ` service ` .
service
T
max_items
usize
max_latency
std::time::Duration