Documentation
¶
Index ¶
- type Configuration
- type Job
- type Queue
- type Redis
- type ServiceProvider
- func (p *ServiceProvider) Boot(app interface{}) error
- func (p *ServiceProvider) Configure(config map[string]interface{}) error
- func (p *ServiceProvider) Name() string
- func (p *ServiceProvider) Priority() int
- func (p *ServiceProvider) Register(app interface{}) error
- func (p *ServiceProvider) Service() *api.Queue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration = api.Configuration
type Queue ¶
func New ¶
New creates a new Queue instance wired to the given Adele application.
Example:
q, err := queue.New(app)
if err != nil {
return err
}
q.Listen()
func NewWithConfig ¶
func NewWithConfig(a *adele.Adele, config Configuration) (*Queue, error)
NewWithConfig creates a new Queue instance with a caller-supplied Configuration, bypassing any on-disk config/queue.yml. Intended for tests and programmatic setup.
Example:
cfg := queue.Configuration{Backend: "memory", WorkerCount: 2}
q, err := queue.NewWithConfig(app, cfg)
if err != nil {
return err
}
type ServiceProvider ¶
type ServiceProvider struct {
// contains filtered or unexported fields
}
ServiceProvider is the compiled Adele framework provider for the queue. It wires up the queue service and starts the worker pool during Boot.
Example:
// Registered automatically via init(). // Construct a queue directly inside your application: q := queue.New(app)
func (*ServiceProvider) Boot ¶
func (p *ServiceProvider) Boot(app interface{}) error
Boot starts the queue worker pool. Called after every provider has been registered so the queue can safely rely on any earlier-booted dependencies.
func (*ServiceProvider) Configure ¶
func (p *ServiceProvider) Configure(config map[string]interface{}) error
Configure maps a config map to the Configuration struct fields and stores it for use during Register.
func (*ServiceProvider) Name ¶
func (p *ServiceProvider) Name() string
Name returns the unique identifier for this provider.
func (*ServiceProvider) Priority ¶
func (p *ServiceProvider) Priority() int
Priority returns 30, placing this provider in the core-services tier per Adele conventions.
func (*ServiceProvider) Register ¶
func (p *ServiceProvider) Register(app interface{}) error
Register initializes the queue service. The queue registers no routes; it runs entirely through the worker pool started in Boot.
func (*ServiceProvider) Service ¶
func (p *ServiceProvider) Service() *api.Queue
Service returns the underlying *api.Queue after Register has been called. May be nil if the provider has not yet been registered.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
bench/benchjobs
Package jobs wires the test-job constructors (written by Wave 1 implementers #1-5) into a single one-shot dispatcher.
|
Package jobs wires the test-job constructors (written by Wave 1 implementers #1-5) into a single one-shot dispatcher. |