Documentation ¶
Overview ¶
Package nsq represents the interface queues implementation.
Index ¶
- Constants
- type Config
- type Envelope
- type Logger
- type Message
- func (m *Message) AttemptsCount() uint16
- func (m *Message) Body() []byte
- func (m *Message) Context() context.Context
- func (m *Message) DisableAutoResponse()
- func (m *Message) Finish()
- func (m *Message) HasResponded() bool
- func (m *Message) QueueAddr() string
- func (m *Message) RequeueWithoutBackoff(delay time.Duration)
- func (m *Message) Subject() string
- func (m *Message) Timestamp() int64
- func (m *Message) Touch()
- type Queue
- func (q *Queue) Ping(ctx context.Context) error
- func (q *Queue) Publish(ctx context.Context, topic string, body []byte) error
- func (q *Queue) Stop(ctx context.Context)
- func (q *Queue) Subscribe(ctx context.Context, topic string, handler queues.Handler) (queues.Subscriber, error)
- func (q *Queue) Unsubscribe(ctx context.Context)
- type Subscription
Constants ¶
const ( // LogLevelDebug - nsq.LogLevelDebug. LogLevelDebug = nsq.LogLevelDebug // LogLevelInfo - nsq.LogLevelInfo. LogLevelInfo = nsq.LogLevelInfo // LogLevelWarning - nsq.LogLevelWarning. LogLevelWarning = nsq.LogLevelWarning // LogLevelError - nsq.LogLevelError. LogLevelError = nsq.LogLevelError )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { NsqConfig *nsq.Config NsqD string NsqLookupDs []string Channel string Log Logger StopTimeout time.Duration Marshaler codec.Marshaler Unmarshaler codec.Unmarshaler }
Config delivers a set of settings for QueueManager implementation.
type Envelope ¶
type Envelope struct { Magic string `json:"$magic"` Header http.Header `json:"$header"` Body json.RawMessage `json:"$body"` }
Envelope transmitted in queues.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message predetermines the consistency of the queues.Message implementation.
func (*Message) AttemptsCount ¶
AttemptsCount provides the message attempts count.
func (*Message) DisableAutoResponse ¶
func (m *Message) DisableAutoResponse()
DisableAutoResponse provides nsq.Message.DisableAutoResponse.
func (*Message) HasResponded ¶
HasResponded provides nsq.Message.HasResponded.
func (*Message) QueueAddr ¶
QueueAddr provides the address of the nsq daemon from which the message came.
func (*Message) RequeueWithoutBackoff ¶
RequeueWithoutBackoff provides nsq.Message.RequeueWithoutBackoff.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue predetermines the consistency of the queues.QueueManager implementation.
func (*Queue) Subscribe ¶
func (q *Queue) Subscribe(ctx context.Context, topic string, handler queues.Handler) (queues.Subscriber, error)
Subscribe carries out accession to the nsq daemon.
func (*Queue) Unsubscribe ¶
Unsubscribe disconnects all subscribers from the nsq daemon.
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
Subscription predetermines the consistency of the queues.Subscriber implementation.
func (*Subscription) Stop ¶
func (s *Subscription) Stop(ctx context.Context)
Stop stops the instance Subscription.
func (*Subscription) Unsubscribe ¶
func (s *Subscription) Unsubscribe(ctx context.Context) error
Unsubscribe disconnects the instance Subscription from nsq daemon.