Documentation ¶
Index ¶
- func Dispatch(payload interface{}) error
- func DispatchAfter(payload interface{}, delay time.Duration) error
- func DispatchOn(payload interface{}, on string) error
- func DispatchOnAfter(payload interface{}, on string, delay time.Duration) error
- func RegisterDriver(name string, dr DriverRegister)
- func RegisterHandler(fn interface{}) error
- func WithDefaults()
- type ConConf
- type Config
- type DriverRegister
- type NsqConfig
- type RedisConfig
- type Service
- type WorkerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DispatchAfter ¶
DispatchAfter, display payload to queue, handle after delay
func DispatchOn ¶
DispatchOn display payload to queue connection
func DispatchOnAfter ¶ added in v0.1.0
DispatchOnAfter display payload to queue connection, handle after delay
func RegisterDriver ¶
func RegisterDriver(name string, dr DriverRegister)
func RegisterHandler ¶
func RegisterHandler(fn interface{}) error
RegisterHandler register queue job handler, automaticly listen job fn is job handler func, first parameter suppose to be queue job payload, support parameter injection
func WithDefaults ¶
func WithDefaults()
Types ¶
type ConConf ¶
type ConConf struct { Driver string `yaml:"driver"` Config yaml.Node `yaml:"config"` }
type Config ¶
type Config struct { Listening bool `yaml:"listen" env:"QUEUE_LISTEN" default:"true"` Connection string `yaml:"connection" env:"QUEUE_CONNECTION" default:"mem"` RunningWorkers []string `yaml:"running_workers"` Workers map[string]WorkerConfig `yaml:"workers"` Connections map[string]ConConf `yaml:"connections"` }
type DriverRegister ¶
type DriverRegister func(config yaml.Node) (c.Connection, error)
func GetDriverRegister ¶
func GetDriverRegister(name string) (DriverRegister, bool)
type RedisConfig ¶ added in v0.1.2
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService() *Service
type WorkerConfig ¶
Click to show internal directories.
Click to hide internal directories.