Versions in this module Expand all Collapse all v3 v3.0.2 Feb 23, 2023 v3.0.1 Aug 31, 2022 Changes in this version + type Client struct + func NewClient(c config.Config) Client + func (c *Client) AbortTask(taskID string, exTime int) error + func (c *Client) Clone() *Client + func (c *Client) GetResult(taskId string, timeout time.Duration, sleepTime time.Duration) (message.Result, error) + func (c *Client) GetResult2(taskId string, timeout time.Duration, sleepTime time.Duration) (message.Result, error) + func (c *Client) GetStatus(taskId string, timeout time.Duration, sleepTime time.Duration) (int, error) + func (c *Client) Send(groupName string, workerName string, args ...interface{}) (string, error) + func (c *Client) SetTaskCtl(name int, value interface{}) *Client + func (c *Client) Workflow() *ClientWithWorkflow + type ClientWithWorkflow struct + WorkflowArgs message.MessageWorkflowArgs + func (c *ClientWithWorkflow) Done() (string, error) + func (c *ClientWithWorkflow) Send(groupName string, workerName string, args ...interface{}) *ClientWithWorkflow + func (c *ClientWithWorkflow) SetTaskCtl(name int, value interface{}) *ClientWithWorkflow + type DelayServer struct + func NewDelayServer(groupName string, c config.Config, msgChan chan message.Message) DelayServer + func (s *DelayServer) GetDelayMsgGoroutine() + func (s *DelayServer) GetDelayMsgGoroutine_UpdateQueue(msg message.Message) + func (s *DelayServer) GetReadyMsgGoroutine() + func (s *DelayServer) GetReadyMsgGoroutine_Send(msg message.Message) (err error) + func (s *DelayServer) IsRunning() bool + func (s *DelayServer) IsStop() bool + func (s *DelayServer) LSendQueue() + func (s *DelayServer) Run() + func (s *DelayServer) SendReadyMsgGoroutine() + func (s *DelayServer) SendReadyMsgGoroutine_Send(msg message.Message) (err error) + func (s *DelayServer) SetRunning() + func (s *DelayServer) SetStop() + func (s *DelayServer) Shutdown(ctx context.Context) error + type FuncWorker struct + CallbackFunc interface{} + Func interface{} + Logger log.LoggerInterface + Name string + func (f *FuncWorker) After(ctl *TaskCtl, funcArgs []string, result *message.Result) error + func (f *FuncWorker) Run(ctl *TaskCtl, funcArgs []string, result *message.Result) error + func (f *FuncWorker) WorkerName() string + type InlineServer struct + func NewInlineServer(groupName string, c config.Config) InlineServer + func (t *InlineServer) Add(workerName string, w interface{}, callbackFunc ...interface{}) + func (t *InlineServer) GetNextMessageGoroutine() + func (t *InlineServer) IsRunning() bool + func (t *InlineServer) IsStop() bool + func (t *InlineServer) MakeWorkerReady() + func (t *InlineServer) Run(numWorkers int) + func (t *InlineServer) SetRunning() + func (t *InlineServer) SetStop() + func (t *InlineServer) Shutdown(ctx context.Context) error + func (t *InlineServer) WorkerGoroutine() + type Server struct + DelayServerMap map[string]*DelayServer + ServerMap map[string]*InlineServer + func NewServer(c config.Config) Server + func (t *Server) Add(groupName string, workerName string, w interface{}, ...) + func (t *Server) GetClient() Client + func (t *Server) Run(groupName string, numWorkers int, enableDelayServer ...bool) + func (t *Server) Shutdown(ctx context.Context) error + type ServerUtils struct + func (b *ServerUtils) AbortTask(id string, exTime int) error + func (b *ServerUtils) BackendActivate() + func (b *ServerUtils) BrokerActivate() + func (b *ServerUtils) GetBackendPoolSize() int + func (b *ServerUtils) GetBrokerPoolSize() int + func (b *ServerUtils) GetResult(id string) (message.Result, error) + func (b *ServerUtils) IsAbort(id string) (bool, error) + func (b *ServerUtils) LSendMsg(groupName string, msg message.Message) error + func (b *ServerUtils) Next(groupName string) (message.Message, error) + func (b *ServerUtils) Send(groupName string, workerName string, msgArgs message.MessageArgs, ...) (string, error) + func (b *ServerUtils) SendMsg(groupName string, msg message.Message) error + func (b *ServerUtils) SetBackendPoolSize(num int) + func (b *ServerUtils) SetBrokerPoolSize(num int) + func (b *ServerUtils) SetResult(result message.Result) error + func (b ServerUtils) GetDelayGroupName(groupName string) string + func (b ServerUtils) GetQueueName(groupName string) string + type SortQueue struct + MaxLen int + Queue []message.Message + func NewSortQueue(maxLen int) SortQueue + func (s *SortQueue) Get(i int) message.Message + func (s *SortQueue) Insert(msg message.Message) *message.Message + func (s *SortQueue) IsFull() bool + func (s *SortQueue) Pop() *message.Message + type TaskCtl struct + func NewTaskCtl(msg message.Message) TaskCtl + func (t *TaskCtl) Abort(msg string) + func (t *TaskCtl) GetRetryCount() int + func (t *TaskCtl) GetRunTime() time.Time + func (t *TaskCtl) GetTaskId() string + func (t *TaskCtl) IsAbort() (bool, error) + func (t *TaskCtl) IsExpired() bool + func (t *TaskCtl) IsZeroRunTime() bool + func (t *TaskCtl) Retry(err error) + func (t *TaskCtl) SetError(err error) + func (t *TaskCtl) SetExpireTime(_t time.Time) + func (t *TaskCtl) SetRetryCount(c int) + func (t *TaskCtl) SetRunTime(_t time.Time) + func (t *TaskCtl) SetServerUtil(su *ServerUtils) + func (t TaskCtl) CanRetry() bool + func (t TaskCtl) GetError() error + type TaskCtlWorkflowArgs struct + ExpireTime time.Time + GroupName string + RetryCount int + RunAfter time.Duration + WorkerName string + type TaskMessage struct + Ctl TaskCtl + FuncArgs []string + Id string + WorkerName string + type WorkerInterface interface + After func(ctl *TaskCtl, funcArgs []string, result *message.Result) error + Run func(ctl *TaskCtl, funcArgs []string, result *message.Result) error + WorkerName func() string Other modules containing this package github.com/gojuukaze/YTask/v2