go-zero/core/queue/consumer.go

13 lines
281 B
Go
Raw Normal View History

2020-08-13 17:00:53 +08:00
package queue
type (
2021-02-22 16:38:42 +08:00
// A Consumer interface represents a consumer that can consume string messages.
2020-08-13 17:00:53 +08:00
Consumer interface {
Consume(string) error
OnEvent(event any)
2020-08-13 17:00:53 +08:00
}
2021-02-22 16:38:42 +08:00
// ConsumerFactory defines the factory to generate consumers.
2020-08-13 17:00:53 +08:00
ConsumerFactory func() (Consumer, error)
)