FetchMaxWait sets custom timeout for fetching predefined batch of messages. If not provided, a default of 30 seconds will be used.
(timeout time.Duration)
| 515 | // |
| 516 | // If not provided, a default of 30 seconds will be used. |
| 517 | func FetchMaxWait(timeout time.Duration) FetchOpt { |
| 518 | return func(req *pullRequest) error { |
| 519 | if timeout <= 0 { |
| 520 | return fmt.Errorf("%w: timeout value must be greater than 0", ErrInvalidOption) |
| 521 | } |
| 522 | req.Expires = timeout |
| 523 | req.maxWaitSet = true |
| 524 | return nil |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | // FetchHeartbeat sets custom heartbeat for individual fetch request. If a |
| 529 | // client does not receive a heartbeat message from a stream for more than 2 |