go-zero/core/queue/producer.go
2021-02-22 16:38:42 +08:00

19 lines
430 B
Go

package queue
type (
// A Producer interface represents a producer that produces messages.
Producer interface {
AddListener(listener ProduceListener)
Produce() (string, bool)
}
// A ProduceListener interface represents a produce listener.
ProduceListener interface {
OnProducerPause()
OnProducerResume()
}
// ProducerFactory defines the method to generate a Producer.
ProducerFactory func() (Producer, error)
)