Documentation ¶
Index ¶
- Variables
- type Session
- func (s *Session) Close() error
- func (s *Session) Connect() error
- func (s *Session) EnsureQueue(con *amqp.Connection, queue string, taskType util.TaskPriority) (*amqp.Queue, error)
- func (s *Session) GetQueueName(pType util.TaskPriority) (string, error)
- func (s *Session) RetryTask(t util.Task) error
- func (s *Session) SendTask(t util.Task) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidPriority = errors.New("cogman: task priority invalid") ErrNotConnected = errors.New("cogman: client not connected") ErrNotPublished = errors.New("cogman: task not published") ErrInvalidConfig = errors.New("cogman: invalid client config") ErrRequestTimeout = errors.New("cogman: request timeout") ErrConnectionTimeout = errors.New("cogman: connection timeout") ErrQueueNotAvailable = errors.New("cogman: queue not available") )
list of client side errors
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session holds necessary fields of a client session
func NewSession ¶
NewSession creates new client session with config cfg
func (*Session) Connect ¶
Connect connects a client session. It also take care reconnection process. For result log, Redis & Mongo connection will be initiated. Mongo indices ensured here. If any conflict occurred, drop the indice table.
func (*Session) EnsureQueue ¶
func (s *Session) EnsureQueue(con *amqp.Connection, queue string, taskType util.TaskPriority) (*amqp.Queue, error)
EnsureQueue ensures that all required queues are available
func (*Session) GetQueueName ¶
func (s *Session) GetQueueName(pType util.TaskPriority) (string, error)
GetQueueName return a available queue name based on task priority
Click to show internal directories.
Click to hide internal directories.