Documentation
¶
Index ¶
- Constants
- func DecodeClusterShardMD(getter headers.HeaderGetter) (client ClusterShardID, server ClusterShardID, err error)
- func EncodeClusterShardMD(sourceClusterShardID ClusterShardID, targetClusterShardID ClusterShardID) metadata.MD
- func NewClient(dc *dynamicconfig.Collection, ...) historyservice.HistoryServiceClient
- func NewConnectionPool[C any](historyServiceResolver membership.ServiceResolver, rpcFactory RPCFactory, ...) *connectionPoolImpl[C]
- func NewMetricClient(client historyservice.HistoryServiceClient, metricsHandler metrics.Handler, ...) historyservice.HistoryServiceClient
- func NewRetryableClient(client historyservice.HistoryServiceClient, policy backoff.RetryPolicy, ...) historyservice.HistoryServiceClient
- type BasicRedirector
- type CachingRedirector
- type ClientOperation
- type ClusterShardID
- type RPCFactory
- type Redirector
Constants ¶
const ( MetadataKeyClientClusterID = "temporal-client-cluster-id" MetadataKeyClientShardID = "temporal-client-shard-id" MetadataKeyServerClusterID = "temporal-server-cluster-id" MetadataKeyServerShardID = "temporal-server-shard-id" )
const ( // DefaultTimeout is the default timeout used to make calls DefaultTimeout = time.Second * 30 * debug.TimeoutMultiplier )
Variables ¶
This section is empty.
Functions ¶
func DecodeClusterShardMD ¶ added in v1.2.0
func DecodeClusterShardMD( getter headers.HeaderGetter, ) (client ClusterShardID, server ClusterShardID, err error)
func EncodeClusterShardMD ¶ added in v1.2.0
func EncodeClusterShardMD( sourceClusterShardID ClusterShardID, targetClusterShardID ClusterShardID, ) metadata.MD
func NewClient ¶
func NewClient( dc *dynamicconfig.Collection, historyServiceResolver membership.ServiceResolver, logger log.Logger, numberOfShards int32, rpcFactory RPCFactory, timeout time.Duration, ) historyservice.HistoryServiceClient
NewClient creates a new history service gRPC client
func NewConnectionPool ¶ added in v1.2.0
func NewConnectionPool[C any]( historyServiceResolver membership.ServiceResolver, rpcFactory RPCFactory, clientCtor func(grpc.ClientConnInterface) C, ) *connectionPoolImpl[C]
func NewMetricClient ¶
func NewMetricClient( client historyservice.HistoryServiceClient, metricsHandler metrics.Handler, logger log.Logger, throttledLogger log.Logger, ) historyservice.HistoryServiceClient
NewMetricClient creates a new instance of historyservice.HistoryServiceClient that emits metrics
func NewRetryableClient ¶ added in v0.3.14
func NewRetryableClient(client historyservice.HistoryServiceClient, policy backoff.RetryPolicy, isRetryable backoff.IsRetryable) historyservice.HistoryServiceClient
NewRetryableClient creates a new instance of historyservice.HistoryServiceClient with retry policy
Types ¶
type BasicRedirector ¶ added in v1.2.0
type BasicRedirector[C any] struct { // contains filtered or unexported fields }
func NewBasicRedirector ¶ added in v1.2.0
func NewBasicRedirector[C any]( connections connectionPool[C], historyServiceResolver membership.ServiceResolver, ) *BasicRedirector[C]
type CachingRedirector ¶ added in v1.2.0
type CachingRedirector[C any] struct { // contains filtered or unexported fields }
A CachingRedirector is a redirector that maintains a cache of shard owners, and uses that cache instead of querying membership for each operation. Cache entries are evicted either for shard ownership lost errors, or for any error that might indicate the history instance is no longer available, including timeouts.
func NewCachingRedirector ¶ added in v1.2.0
func NewCachingRedirector[C any]( connections connectionPool[C], historyServiceResolver membership.ServiceResolver, logger log.Logger, staleTTL dynamicconfig.DurationPropertyFn, ) *CachingRedirector[C]
type ClientOperation ¶ added in v1.2.0
type ClusterShardID ¶ added in v1.2.0
type RPCFactory ¶ added in v1.2.0
type RPCFactory interface {
CreateHistoryGRPCConnection(rpcAddress string) grpc.ClientConnInterface
}
RPCFactory is a subset of the common.RPCFactory interface for testing.
type Redirector ¶ added in v1.2.0
type Redirector[C any] interface { Execute(ctx context.Context, shardID int32, op ClientOperation[C]) error // contains filtered or unexported methods }
A Redirector executes a client operation against a history instance. If the operation is intended for the owner of a shard, and the request returns a shard ownership lost error with a hint for a new shard owner, the redirector will retry the request to the new owner.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package historytest contains library test functions for history.NewClient that use ahistory task queue manager.
|
Package historytest contains library test functions for history.NewClient that use ahistory task queue manager. |