Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config[P any, S any, T Processor[P, S]] struct { // Workers represent the maximum number of Jobs that can be in-flight at one time by having a // maximum number of workers. // Default will be set to one. Workers int // Pollers indicate the maximum number of polling workers trying to retrieve Jobs for processing. // this should only be tuned for consistent high-flow services for which a single poller becomes the // bottleneck which is rare. This should never be set greater than the maximum number of workers and in // most cases should be far less than. // By default, there will only be one poller which should be all you need 99.99999% of the time. Pollers int // EnableAutocomplete turns on auto-completion of a Job that is processed without error. EnableAutocomplete bool // Processor is the main processor of Jobs. Processor T // Queue is the Jbo Queue for which to pull jobs from for processing. Queue string // Client represents the pre-configured low-level relay client. Client *relay.Client[P, S] // Backoff if the backoff used when calling the `next` or `complete` endpoint and there is no data yet // available. // Optional: If not set a default backoff is used. Backoff backoff.Exponential }
Config contains all configuration data to initialize a Consumer for use.
type Consumer ¶
Consumer is a wrapper around the low-level Relay Client to abstract away polling and distribution of Jobs for processing.
type Processor ¶
type Processor[P any, S any] interface { // Process processes the Job. // // NOTE: An error returned by this will NOT bubble up beyond this function, it's the responsibility of each // Processor to handle its own errors. This signature only exists to allow wrapping the Processor like // middleware to intercept it and perform actions based upon it. Process(context.Context, *relay.JobHelper[P, S]) error }
Processor represents a processor of Jobs
Click to show internal directories.
Click to hide internal directories.