File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -424,12 +424,15 @@ macro_rules! impl_stream_sink {
424
424
}
425
425
}
426
426
427
- /// By default the sink works in normal mode, that is, `start_send` always starts to send message
428
- /// immediately. But when the `enhance_batch` is enabled, the stream will be batched together as
429
- /// much as possible. The specific rules are listed below:
430
- /// Set the `buffer_hint` of the non-end message in the stream to true. And set the `buffer_hint`
431
- /// of the last message to false in `poll_flush` only when there is at least one message with the
432
- /// `buffer_hint` false, so that the previously bufferd messages will be sent out.
427
+ /// By default it always sends messages with their configured buffer hint. But when the
428
+ /// `enhance_batch` is enabled, messages will be batched together as many as possible.
429
+ /// The rules are listed as below:
430
+ /// - All messages except the last one will be sent with `buffer_hint` set to true.
431
+ /// - The last message will also be sent with `buffer_hint` set to true unless all messages are
432
+ /// offered with buffer hint set to true.
433
+ ///
434
+ /// No matter `enhance_batch` is true or false, it's recommended to follow the contract of
435
+ /// Sink and call `poll_flush` to ensure messages are handled by gRPC C Core.
433
436
pub fn enhance_batch( & mut self , flag: bool ) {
434
437
self . base. enhance_buffer_strategy = flag;
435
438
}
You can’t perform that action at this time.
0 commit comments