Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DefaultCEClientOpts = []ceclient.Option{ ceclient.WithUUIDs(), ceclient.WithTimeNow(), ceclient.WithTracePropagation(), } DefaultHTTPOpts = []cehttp.Option{ cehttp.WithRoundTripper(&ochttp.Transport{Propagation: &tracecontext.HTTPFormat{}}), } // ProviderSet provides the fanout and retry sync pools using the default client options. In // order to inject either pool, ProjectID, []Option, and config.ReadOnlyTargets must be // externally provided. ProviderSet = wire.NewSet( NewFanoutPool, NewRetryPool, cehttp.New, NewDeliverClient, NewPubsubClient, NewRetryClient, wire.Value(DefaultHTTPOpts), wire.Value(DefaultCEClientOpts), ) )
Functions ¶
Types ¶
type DeliverClient ¶ added in v0.15.0
func NewDeliverClient ¶ added in v0.15.0
NewDeliverClient provides a delivery CE client from an HTTP protocol and a list of CE client options.
type FanoutPool ¶ added in v0.15.0
type FanoutPool struct {
// contains filtered or unexported fields
}
FanoutPool is the sync pool for fanout handlers. For each broker in the config, it will attempt to create a handler. It will also stop/delete the handler if the corresponding broker is deleted in the config.
func InitializeTestFanoutPool ¶ added in v0.15.0
func InitializeTestFanoutPool(ctx context.Context, targets config.ReadonlyTargets, pubsubClient *pubsub.Client, opts ...Option) (*FanoutPool, error)
func NewFanoutPool ¶ added in v0.15.0
func NewFanoutPool( targets config.ReadonlyTargets, pubsubClient *pubsub.Client, deliverClient DeliverClient, retryClient RetryClient, opts ...Option, ) (*FanoutPool, error)
NewFanoutPool creates a new fanout handler pool.
type Option ¶
type Option func(*Options)
Option is for providing individual option.
func WithDeliveryTimeout ¶ added in v0.15.0
WithDeliveryTimeout sets the DeliveryTimeout.
func WithHandlerConcurrency ¶
WithHandlerConcurrency sets HandlerConcurrency.
func WithMaxConcurrentPerEvent ¶
WithMaxConcurrentPerEvent sets MaxConcurrencyPerEvent.
func WithPubsubReceiveSettings ¶
func WithPubsubReceiveSettings(s pubsub.ReceiveSettings) Option
WithPubsubReceiveSettings sets PubsubReceiveSettings.
func WithTimeoutPerEvent ¶
WithTimeoutPerEvent sets TimeoutPerEvent.
type Options ¶
type Options struct { // HandlerConcurrency is the number of goroutines // will be spawned in each handler. HandlerConcurrency int // MaxConcurrencyPerEvent is the max number of goroutines // will be spawned to handle an event. MaxConcurrencyPerEvent int // TimeoutPerEvent is the timeout for handling an event. TimeoutPerEvent time.Duration // DeliveryTimeout is the timeout for delivering an event to a consumer. DeliveryTimeout time.Duration // PubsubReceiveSettings is the pubsub receive settings. PubsubReceiveSettings pubsub.ReceiveSettings }
Options holds all the options for create handler pool.
type RetryClient ¶ added in v0.15.0
func NewRetryClient ¶ added in v0.15.0
func NewRetryClient(ctx context.Context, client *pubsub.Client, opts ...ceclient.Option) (RetryClient, error)
NewRetryClient provides a retry CE client from a PubSub client and list of CE client options.
type RetryPool ¶ added in v0.15.0
type RetryPool struct {
// contains filtered or unexported fields
}
RetryPool is the sync pool for retry handlers. For each trigger in the config, it will attempt to create a handler. It will also stop/delete the handler if the corresponding trigger is deleted in the config.
func InitializeTestRetryPool ¶ added in v0.15.0
func NewRetryPool ¶ added in v0.15.0
func NewRetryPool(targets config.ReadonlyTargets, pubsubClient *pubsub.Client, deliverClient DeliverClient, opts ...Option) (*RetryPool, error)
NewRetryPool creates a new retry handler pool.