You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-zero/core/queue/producer.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)
)