Documentation
¶
Index ¶
- type Client
- func (c *Client) Clone() *Client
- func (c *Client) GetResult(taskId string, timeout time.Duration, sleepTime time.Duration) (message.Result, error)
- func (c *Client) Send(groupName string, workerName string, args ...interface{}) (string, error)
- func (c *Client) SetTaskCtl(name string, value interface{}) *Client
- type Server
- func (t *Server) Add(groupName string, workerName string, w interface{})
- func (t *Server) GetClient() Client
- func (t *Server) GetNextMessageGoroutine(groupName string)
- func (t *Server) GetQueryName(groupName string) string
- func (t *Server) GetResult(id string) (message.Result, error)
- func (t *Server) MakeWorkerReady()
- func (t *Server) Next(groupName string) (message.Message, error)
- func (t *Server) Run(groupName string, numWorkers int)
- func (t *Server) Send(groupName string, workerName string, ctl controller.TaskCtl, ...) (string, error)
- func (t *Server) SetResult(result message.Result) error
- func (t *Server) Shutdown(ctx context.Context) error
- func (t *Server) WorkerGoroutine(groupName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// ctl name
RetryCount string
// contains filtered or unexported fields
}
func (*Client) GetResult ¶
func (c *Client) GetResult(taskId string, timeout time.Duration, sleepTime time.Duration) (message.Result, error)
taskId: timeout: sleepDuration:
func (*Client) SetTaskCtl ¶
type Server ¶
type Server struct {
sync.Map
// config
StatusExpires int // second, -1:forever
ResultExpires int // second, -1:forever
// contains filtered or unexported fields
}
func (*Server) GetNextMessageGoroutine ¶
get next message if worker is ready
func (*Server) GetQueryName ¶
func (*Server) MakeWorkerReady ¶
func (t *Server) MakeWorkerReady()
func (*Server) Send ¶
func (t *Server) Send(groupName string, workerName string, ctl controller.TaskCtl, args ...interface{}) (string, error)
send msg to queue t.Send("groupName", "workerName" , 1,"hi",1.2)
func (*Server) WorkerGoroutine ¶
start worker to run
Click to show internal directories.
Click to hide internal directories.