Documentation ¶
Index ¶
- type Consumer
- func (cons *Consumer) AddConcurrentHandlers(handler nsqio.Handler, concurrency int)
- func (cons *Consumer) AddHandler(handler nsqio.Handler)
- func (cons *Consumer) ChangeMaxInFlight(n int)
- func (cons *Consumer) Channel() string
- func (cons *Consumer) Concurrency() int
- func (cons *Consumer) ConnectToNSQLookupds(addresses []string) error
- func (cons *Consumer) MaxInFlight() int
- func (cons *Consumer) Stop()
- func (cons *Consumer) Topic() string
- type ConsumerConfig
- type FakeNSQ
- type LookUpD
- type MessageDelegator
- type Producer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer is the consumer of NSQ, the consumer relay message to message handler.
func (*Consumer) AddConcurrentHandlers ¶
AddConcurrentHandlers for nsq
func (*Consumer) AddHandler ¶
AddHandler for nsq
func (*Consumer) ChangeMaxInFlight ¶
ChangeMaxInFlight message in nsq consumer
func (*Consumer) Concurrency ¶
Concurrency return the number of conccurent worker
func (*Consumer) ConnectToNSQLookupds ¶
ConnectToNSQLookupds for nsq
func (*Consumer) MaxInFlight ¶
MaxInFlight return the maximum in flight number for nsq.
type ConsumerConfig ¶
ConsumerConfig of fake nsq
func (*ConsumerConfig) Validate ¶
func (cc *ConsumerConfig) Validate() error
Validate consumer configuration
type FakeNSQ ¶
type FakeNSQ struct {
// contains filtered or unexported fields
}
FakeNSQ mimic several NSQ features, mostly for publishing and consuming message. The purpose is to not rely on the real NSQ for testing.
func (*FakeNSQ) NewConsumer ¶
func (fnsq *FakeNSQ) NewConsumer(config ConsumerConfig) *Consumer
NewConsumer return a fakensq consumer for consuming message from fakensq. The consumer will register the topic and channel to fakensq lookupd registrar for topic and channel discovery.
func (*FakeNSQ) NewProducer ¶
NewProducer return a fakensq producer for publishing message to fakensq. The producer will automatically publish the message into the designated topic if topic/channel is available.
type LookUpD ¶
type LookUpD struct {
// contains filtered or unexported fields
}
LookUpD for fakensq. The lookUpD will store all informations of messages channeling for specific topic and channel.
type MessageDelegator ¶
type MessageDelegator struct {
// contains filtered or unexported fields
}
MessageDelegator implement Delegator of nsqio
func (*MessageDelegator) OnFinish ¶
func (mdm *MessageDelegator) OnFinish(message *nsqio.Message)
func (*MessageDelegator) OnTouch ¶
func (mdm *MessageDelegator) OnTouch(m *nsqio.Message)
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer for fakensq. The producer will publish message to all channels for specific topic, based on information from the lookUpD.
func (*Producer) MultiPublish ¶
MultiPublish message