Documentation
¶
Index ¶
- type Option
- func WithAddr(addr string) Option
- func WithChannel(channel string) Option
- func WithLogLevel(lvl nsq.LogLevel) Option
- func WithLogger(l queue.Logger) Option
- func WithMaxInFlight(num int) Option
- func WithRunFunc(fn func(context.Context, core.TaskMessage) error) Option
- func WithTopic(topic string) Option
- type OptionFunc
- type Options
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
Apply(*Options)
}
An Option configures a mutex.
func WithLogLevel ¶ added in v0.2.0
WithLogLevel set custom nsq log level
func WithMaxInFlight ¶
WithMaxInFlight Maximum number of messages to allow in flight (concurrency knob)
func WithRunFunc ¶
WithRunFunc setup the run func of queue
type OptionFunc ¶ added in v0.1.0
type OptionFunc func(*Options)
OptionFunc is a function that configures a queue.
func (OptionFunc) Apply ¶ added in v0.1.0
func (f OptionFunc) Apply(option *Options)
Apply calls f(option)
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker for NSQ
func (*Worker) Queue ¶
func (w *Worker) Queue(job core.TaskMessage) error
Queue send notification to queue
func (*Worker) Request ¶ added in v0.1.0
func (w *Worker) Request() (core.TaskMessage, error)
Request fetch new task from queue
func (*Worker) Stats ¶ added in v0.1.0
func (w *Worker) Stats() *nsq.ConsumerStats
Stats retrieves the current connection and message statistics for a Consumer
Click to show internal directories.
Click to hide internal directories.