mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 01:30:25 +08:00
19 lines
430 B
Go
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)
|
|
)
|