add stream timeout option which defaults to 0 (#1456)
* add stream timeout option which defaults to 0 * fix option
This commit is contained in:
@@ -57,6 +57,8 @@ type CallOptions struct {
|
||||
Retries int
|
||||
// Request/Response timeout
|
||||
RequestTimeout time.Duration
|
||||
// Stream timeout for the stream
|
||||
StreamTimeout time.Duration
|
||||
// Use the services own auth token
|
||||
ServiceToken bool
|
||||
|
||||
@@ -227,6 +229,13 @@ func RequestTimeout(d time.Duration) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// StreamTimeout sets the stream timeout
|
||||
func StreamTimeout(d time.Duration) Option {
|
||||
return func(o *Options) {
|
||||
o.CallOptions.StreamTimeout = d
|
||||
}
|
||||
}
|
||||
|
||||
// Transport dial timeout
|
||||
func DialTimeout(d time.Duration) Option {
|
||||
return func(o *Options) {
|
||||
@@ -295,6 +304,13 @@ func WithRequestTimeout(d time.Duration) CallOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithStreamTimeout sets the stream timeout
|
||||
func WithStreamTimeout(d time.Duration) CallOption {
|
||||
return func(o *CallOptions) {
|
||||
o.StreamTimeout = d
|
||||
}
|
||||
}
|
||||
|
||||
// WithDialTimeout is a CallOption which overrides that which
|
||||
// set in Options.CallOptions
|
||||
func WithDialTimeout(d time.Duration) CallOption {
|
||||
|
Reference in New Issue
Block a user