Documentation ¶
Index ¶
- type Option
- func WithHandlerConcurrency(c int) Option
- func WithMaxConcurrentPerEvent(c int) Option
- func WithProjectID(id string) Option
- func WithPubsubClient(c *pubsub.Client) Option
- func WithPubsubReceiveSettings(s pubsub.ReceiveSettings) Option
- func WithSyncSignal(s <-chan struct{}) Option
- func WithTimeoutPerEvent(t time.Duration) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
Option is for providing individual option.
func WithHandlerConcurrency ¶
WithHandlerConcurrency sets HandlerConcurrency.
func WithMaxConcurrentPerEvent ¶
WithMaxConcurrentPerEvent sets MaxConcurrencyPerEvent.
func WithPubsubClient ¶
WithPubsubClient sets the PubsubClient.
func WithPubsubReceiveSettings ¶
func WithPubsubReceiveSettings(s pubsub.ReceiveSettings) Option
WithPubsubReceiveSettings sets PubsubReceiveSettings.
func WithTimeoutPerEvent ¶
WithTimeoutPerEvent sets TimeoutPerEvent.
type Options ¶
type Options struct { // ProjectID is the project for pubsub. ProjectID string // 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 // PubsubClient is the pubsub client used to receive pubsub messages. PubsubClient *pubsub.Client // PubsubReceiveSettings is the pubsub receive settings. PubsubReceiveSettings pubsub.ReceiveSettings // EventRequester is the cloudevents client to deliver events. EventRequester ceclient.Client // SyncSignal is the signal to sync handler pool. SyncSignal <-chan struct{} }
Options holds all the options for create handler pool.
Click to show internal directories.
Click to hide internal directories.