Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerFunc ¶
type ConsumerFunc func(interface{}) error
type ProducerFunc ¶
type ProducerFunc func(ch chan<- interface{}, isShouldStop func() bool) // 比定义一个Interface要简洁一些
type SimpleConsumer ¶
type SimpleConsumer struct {
// contains filtered or unexported fields
}
func NewSimpleConsumer ¶
func NewSimpleConsumer(f ConsumerFunc) *SimpleConsumer
func (*SimpleConsumer) Close ¶
func (sc *SimpleConsumer) Close()
func (*SimpleConsumer) Do ¶
func (sc *SimpleConsumer) Do(msg interface{}) error
func (*SimpleConsumer) Init ¶
func (sc *SimpleConsumer) Init() error
type SimpleProducer ¶
type SimpleProducer struct {
// contains filtered or unexported fields
}
func NewSimpleProducer ¶
func NewSimpleProducer(f ProducerFunc) *SimpleProducer
func (*SimpleProducer) Close ¶
func (sp *SimpleProducer) Close()
func (*SimpleProducer) Do ¶
func (sp *SimpleProducer) Do(ch chan<- interface{})
func (*SimpleProducer) Init ¶
func (sp *SimpleProducer) Init() error
func (*SimpleProducer) ShouldStop ¶
func (sp *SimpleProducer) ShouldStop() bool
type Stats ¶
Click to show internal directories.
Click to hide internal directories.