Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingWorker = errors.New("missing worker module")
ErrMissingWorker missing define worker
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Infof(format string, args ...interface{})
Errorf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
Info(args ...interface{})
Error(args ...interface{})
Fatal(args ...interface{})
}
Logger interface is used throughout gorush
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
A Queue is a message queue.
type Worker ¶
type Worker interface {
// BeforeRun is called before starting the worker
BeforeRun() error
// Run is called to start the worker
Run(chan struct{}) error
// BeforeRun is called after starting the worker
AfterRun() error
// Shutdown is called if stop all worker
Shutdown() error
// Queue to send message in Queue (single channel, NSQ or AWS SQS)
Queue(job QueuedMessage) error
// Capacity queue capacity = cap(channel name)
Capacity() int
// Usage is how many message in queue
Usage() int
}
Worker interface
Click to show internal directories.
Click to hide internal directories.