Documentation
¶
Index ¶
- Constants
- func NewClient(timeout time.Duration, longPollTimeout time.Duration, ...) matchingservice.MatchingServiceClient
- func NewMetricClient(client matchingservice.MatchingServiceClient, metricsHandler metrics.Handler, ...) matchingservice.MatchingServiceClient
- func NewRetryableClient(client matchingservice.MatchingServiceClient, ...) matchingservice.MatchingServiceClient
- func ParseEstimatedTasksAllPartitions(ctx context.Context) int
- type LoadBalancer
- type PartitionCounts
- type RoutingClient
Constants ¶
View Source
const ( // DefaultTimeout is the max timeout for regular calls DefaultTimeout = time.Minute * debug.TimeoutMultiplier // DefaultLongPollTimeout is the max timeout for long poll calls DefaultLongPollTimeout = time.Minute * 5 * debug.TimeoutMultiplier )
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient( timeout time.Duration, longPollTimeout time.Duration, clients common.ClientCache, metricsHandler metrics.Handler, logger log.Logger, lb LoadBalancer, spreadRouting dynamicconfig.TypedPropertyFn[dynamicconfig.GradualChange[int]], resolver membership.ServiceResolver, connectionCloseDelay dynamicconfig.DurationPropertyFn, ) matchingservice.MatchingServiceClient
NewClient creates a new matching service gRPC client
func NewMetricClient ¶
func NewMetricClient( client matchingservice.MatchingServiceClient, metricsHandler metrics.Handler, logger log.Logger, throttledLogger log.Logger, ) matchingservice.MatchingServiceClient
NewMetricClient creates a new instance of matchingservice.MatchingServiceClient that emits metrics
func NewRetryableClient ¶
func NewRetryableClient( client matchingservice.MatchingServiceClient, policy, pollPolicy backoff.RetryPolicy, isRetryable backoff.IsRetryable, ) matchingservice.MatchingServiceClient
NewRetryableClient creates a new instance of matchingservice.MatchingServiceClient with retry policy
Types ¶
type LoadBalancer ¶
type LoadBalancer interface {
// PickWritePartition returns the task queue partition for adding an
// activity or workflow task and the estimated number of tasks added
// across all partitions per root task. The input is the name of the
// original task queue (with no partition info).
PickWritePartition(
taskQueue *tqid.TaskQueue,
pc PartitionCounts,
) (*tqid.NormalPartition, int)
// PickReadPartition returns the task queue partition to send a poller to.
// Input is name of the original task queue as specified by caller.
PickReadPartition(
taskQueue *tqid.TaskQueue,
pc PartitionCounts,
) *pollToken
}
LoadBalancer is the interface for implementers of component that distributes add/poll api calls across available task queue partitions when possible
func NewLoadBalancer ¶
func NewLoadBalancer( namespaceIDToName func(id namespace.ID) (namespace.Name, error), dc *dynamicconfig.Collection, testHooks testhooks.TestHooks, ) LoadBalancer
NewLoadBalancer returns an instance of matching load balancer that can help distribute api calls across task queue partitions
type PartitionCounts ¶
type PartitionCounts struct {
Read, Write int32
BacklogCap number.Compact8
BacklogCount []number.Compact8
}
PartitionCounts is a smaller version of taskqueuespb.ClientPartitionCounts that we can more easily pass around and put in a map.
func ParsePartitionCountsFromIncomingContext ¶
func ParsePartitionCountsFromIncomingContext(ctx context.Context) (PartitionCounts, error)
func (PartitionCounts) Equal ¶
func (pc PartitionCounts) Equal(other PartitionCounts) bool
func (PartitionCounts) SetTrailer ¶
func (pc PartitionCounts) SetTrailer(ctx context.Context) error
func (PartitionCounts) Valid ¶
func (pc PartitionCounts) Valid() bool
Click to show internal directories.
Click to hide internal directories.