Documentation
¶
Index ¶
- Variables
- type Configuration
- type Connector
- func (c *Connector) Close() error
- func (c *Connector) Config() *Configuration
- func (c *Connector) HandlePayload(task *common.Task)
- func (c *Connector) Init() error
- func (c *Connector) OnTaskAcceptTimeout(task *common.Task)
- func (c *Connector) OnTaskError(task *common.Task, err error)
- func (c *Connector) OnTaskHeartbeat(task *common.Task)
- func (c *Connector) OnTaskQueued(task *common.Task)
- func (c *Connector) OnTaskResult(task *common.Task, a ...interface{})
- func (c *Connector) OnTaskSuccess(task *common.Task)
- func (c *Connector) SetEventHandler(eventHandler common.TaskQueueEventHandler)
- func (c *Connector) SetTaskEventChannel(eventChannel chan<- *common.TaskProcessEvent)
- func (c *Connector) SetTaskQueueChannel(taskQueueChannel chan<- *common.Task)
- type Handler
Constants ¶
This section is empty.
Variables ¶
View Source
var WireSet = wire.NewSet(NewConnector, NewConfiguration, wire.Bind(new(Handler), new(*Connector)))
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
WaitToAcceptConsumerTask time.Duration
WaitToAcceptEvent time.Duration
}
func NewConfiguration ¶
func NewConfiguration() *Configuration
type Connector ¶
type Connector struct {
*Configuration
// contains filtered or unexported fields
}
func NewConnector ¶
func NewConnector(config *Configuration) *Connector
func (*Connector) Config ¶
func (c *Connector) Config() *Configuration
func (*Connector) HandlePayload ¶
Handles task payload from consumer
func (*Connector) OnTaskAcceptTimeout ¶
func (*Connector) OnTaskHeartbeat ¶
func (*Connector) OnTaskQueued ¶
func (*Connector) OnTaskResult ¶
func (*Connector) OnTaskSuccess ¶
func (*Connector) SetEventHandler ¶
func (c *Connector) SetEventHandler(eventHandler common.TaskQueueEventHandler)
func (*Connector) SetTaskEventChannel ¶
func (c *Connector) SetTaskEventChannel( eventChannel chan<- *common.TaskProcessEvent)
func (*Connector) SetTaskQueueChannel ¶
type Handler ¶
type Handler interface {
Init() error
Close() error
Config() *Configuration
SetTaskEventChannel(eventChannel chan<- *common.TaskProcessEvent)
SetTaskQueueChannel(taskQueueChannel chan<- *common.Task)
SetEventHandler(eventHandler common.TaskQueueEventHandler)
}
Click to show internal directories.
Click to hide internal directories.