pool

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

func WithHandlerConcurrency(c int) Option

WithHandlerConcurrency sets HandlerConcurrency.

func WithMaxConcurrentPerEvent

func WithMaxConcurrentPerEvent(c int) Option

WithMaxConcurrentPerEvent sets MaxConcurrencyPerEvent.

func WithProjectID

func WithProjectID(id string) Option

WithProjectID sets project ID.

func WithPubsubClient

func WithPubsubClient(c *pubsub.Client) Option

WithPubsubClient sets the PubsubClient.

func WithPubsubReceiveSettings

func WithPubsubReceiveSettings(s pubsub.ReceiveSettings) Option

WithPubsubReceiveSettings sets PubsubReceiveSettings.

func WithSyncSignal

func WithSyncSignal(s <-chan struct{}) Option

WithSyncSignal sets SyncSignal.

func WithTimeoutPerEvent

func WithTimeoutPerEvent(t time.Duration) Option

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.

func NewOptions

func NewOptions(opts ...Option) *Options

NewOptions creates a Options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL