Documentation ¶
Overview ¶
Package testbroker exports a broker implementation that should be used in package testing.
Index ¶
- type TestBroker
- func (tb *TestBroker) Archive(msg *base.TaskMessage, errMsg string) error
- func (tb *TestBroker) CancelationPubSub() (*redis.PubSub, error)
- func (tb *TestBroker) CheckAndEnqueue(qnames ...string) error
- func (tb *TestBroker) ClearServerState(host string, pid int, serverID string) error
- func (tb *TestBroker) Close() error
- func (tb *TestBroker) Dequeue(qnames ...string) (*base.TaskMessage, time.Time, error)
- func (tb *TestBroker) Done(msg *base.TaskMessage) error
- func (tb *TestBroker) Enqueue(msg *base.TaskMessage) error
- func (tb *TestBroker) EnqueueUnique(msg *base.TaskMessage, ttl time.Duration) error
- func (tb *TestBroker) ListDeadlineExceeded(deadline time.Time, qnames ...string) ([]*base.TaskMessage, error)
- func (tb *TestBroker) Ping() error
- func (tb *TestBroker) PublishCancelation(id string) error
- func (tb *TestBroker) Requeue(msg *base.TaskMessage) error
- func (tb *TestBroker) Retry(msg *base.TaskMessage, processAt time.Time, errMsg string) error
- func (tb *TestBroker) Schedule(msg *base.TaskMessage, processAt time.Time) error
- func (tb *TestBroker) ScheduleUnique(msg *base.TaskMessage, processAt time.Time, ttl time.Duration) error
- func (tb *TestBroker) Sleep()
- func (tb *TestBroker) Wakeup()
- func (tb *TestBroker) WriteServerState(info *base.ServerInfo, workers []*base.WorkerInfo, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestBroker ¶
type TestBroker struct {
// contains filtered or unexported fields
}
TestBroker is a broker implementation which enables to simulate Redis failure in tests.
func NewTestBroker ¶
func NewTestBroker(b base.Broker) *TestBroker
func (*TestBroker) Archive ¶
func (tb *TestBroker) Archive(msg *base.TaskMessage, errMsg string) error
func (*TestBroker) CancelationPubSub ¶
func (tb *TestBroker) CancelationPubSub() (*redis.PubSub, error)
func (*TestBroker) CheckAndEnqueue ¶
func (tb *TestBroker) CheckAndEnqueue(qnames ...string) error
func (*TestBroker) ClearServerState ¶
func (tb *TestBroker) ClearServerState(host string, pid int, serverID string) error
func (*TestBroker) Close ¶
func (tb *TestBroker) Close() error
func (*TestBroker) Dequeue ¶
func (tb *TestBroker) Dequeue(qnames ...string) (*base.TaskMessage, time.Time, error)
func (*TestBroker) Done ¶
func (tb *TestBroker) Done(msg *base.TaskMessage) error
func (*TestBroker) Enqueue ¶
func (tb *TestBroker) Enqueue(msg *base.TaskMessage) error
func (*TestBroker) EnqueueUnique ¶
func (tb *TestBroker) EnqueueUnique(msg *base.TaskMessage, ttl time.Duration) error
func (*TestBroker) ListDeadlineExceeded ¶
func (tb *TestBroker) ListDeadlineExceeded(deadline time.Time, qnames ...string) ([]*base.TaskMessage, error)
func (*TestBroker) Ping ¶
func (tb *TestBroker) Ping() error
func (*TestBroker) PublishCancelation ¶
func (tb *TestBroker) PublishCancelation(id string) error
func (*TestBroker) Requeue ¶
func (tb *TestBroker) Requeue(msg *base.TaskMessage) error
func (*TestBroker) Retry ¶
func (tb *TestBroker) Retry(msg *base.TaskMessage, processAt time.Time, errMsg string) error
func (*TestBroker) Schedule ¶
func (tb *TestBroker) Schedule(msg *base.TaskMessage, processAt time.Time) error
func (*TestBroker) ScheduleUnique ¶
func (tb *TestBroker) ScheduleUnique(msg *base.TaskMessage, processAt time.Time, ttl time.Duration) error
func (*TestBroker) Sleep ¶
func (tb *TestBroker) Sleep()
func (*TestBroker) Wakeup ¶
func (tb *TestBroker) Wakeup()
func (*TestBroker) WriteServerState ¶
func (tb *TestBroker) WriteServerState(info *base.ServerInfo, workers []*base.WorkerInfo, ttl time.Duration) error
Click to show internal directories.
Click to hide internal directories.