withBatch method
Runs callback
and batches any requests sent until it returns.
A batch of requests is sent in a single message on the underlying stream, and the responses are likewise sent back in a single message.
callback
may be synchronous or asynchronous. If it returns a Future,
requests will be batched until that Future returns; otherwise, requests
will only be batched while synchronously executing callback
.
If this is called in the context of another withBatch call, it just
invokes callback
without creating another batch. This means that
responses are batched until the first batch ends.
Implementation
@override
void withBatch(Function() callback) => _client.withBatch(callback);