Documentation
¶
Index ¶
- func GetCallOptions(ops []Option) []callopt.Option
- type Option
- func ConvertOptionFrom(option callopt.Option) Optiondeprecated
- func WithConnectTimeout(d time.Duration) Option
- func WithGRPCCompressor(compressorName string) Option
- func WithHostPort(hostPort string) Option
- func WithRecvTimeout(d time.Duration) Optiondeprecated
- func WithRecvTimeoutConfig(cfg streaming.TimeoutConfig) Option
- func WithTag(key, val string) Option
- func WithURL(url string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCallOptions ¶
GetCallOptions converts given streamcall.Option(s) to callopt.Option
Types ¶
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option is the option type used in StreamClient's Call method
func ConvertOptionFrom
deprecated
Deprecated: it's not supposed to be called by users directly; may be removed in future versions. ConvertOptionFrom converts a callopt.Option to StreamOption It's convenient for creating StreamOption from existing callopt.Option Note: NOT all callopt.Option(s) converted will work for stream clients; Even if it works for now, it's NOT guaranteed that it will always work for future versions.
func WithConnectTimeout ¶
WithConnectTimeout specifies the connection timeout for a RPC call.
func WithGRPCCompressor ¶
WithGRPCCompressor specifies the compressor for the GRPC frame payload.
func WithHostPort ¶
WithHostPort specifies the target address for an RPC call.
func WithRecvTimeout
deprecated
added in
v0.13.0
WithRecvTimeout add recv timeout for stream.Recv function. NOTICE: ONLY effective for ttheader streaming protocol for now.
Deprecated: using WithRecvTimeoutConfig When WithRecvTimeout and WithRecvTimeoutConfig are both configured for ttstream, WithRecvTimeoutConfig has higher priority.
func WithRecvTimeoutConfig ¶ added in v0.16.0
func WithRecvTimeoutConfig(cfg streaming.TimeoutConfig) Option
WithRecvTimeoutConfig add recv timeout for stream.Recv function. By default, it will cancel the remote peer when timeout.
However, in certain scenarios (e.g., resume-enabled transfers: A → B → C), A may not wish to cancel B and C upon detecting a timeout. It expects B and C to complete one round of streaming communication and cache the results. This allows A to resume the request from the disconnected point on the next attempt, completing the resume-from-breakpoint process. Config like this:
WithRecvTimeoutConfig(streaming.TimeoutConfig{
Timeout: tm,
DisableCancelRemote: true,
})
The remote peer must promptly exit the handler; otherwise, there is a risk of stream leakage!
func WithURL ¶
WithURL specifies the target for a RPC call with url. The given url will be resolved to hostport and overwrites the result from Resolver.