Documentation
¶
Index ¶
Constants ¶
View Source
const ShopIDHeader = "shopID"
Variables ¶
This section is empty.
Functions ¶
func GetTaskSignature ¶
func GetTaskSignature(cfg *TaskConfig, args ...interface{}) *tasks.Signature
GetTaskSignature returns machinery's task signature object to use with SendTask and SendTaskWithContext functions
func SetupLoggers ¶
func SetupLoggers()
Types ¶
type Server ¶
func NewServer ¶
func NewServer( cnf *config.Config, brokerServer brokersiface.Broker, backendServer backendsiface.Backend, lock lockiface.Lock, ) *Server
NewServer creates Server instance
func (*Server) WrapNewWorker ¶
WrapNewWorker creates a new machinery worker with a random UUID as tag
func (*Server) WrapSendTask ¶
func (m *Server) WrapSendTask(cfg *TaskConfig, args ...interface{}) (*result.AsyncResult, error)
WrapSendTask calls machinery's SendTask function with task signature created using GetTaskSignature function
func (*Server) WrapSendTaskWithContext ¶
func (m *Server) WrapSendTaskWithContext(ctx context.Context, cfg *TaskConfig, args ...interface{}) (*result.AsyncResult, error)
type TaskConfig ¶ added in v1.0.5
type TaskConfig struct {
Name string
ShopID uint64
Delay time.Duration
RetryCount int
OnSuccess *TaskConfig
OnError *TaskConfig
}
Click to show internal directories.
Click to hide internal directories.