wheat-cache/pkg/event/consumer.go

18 lines
269 B
Go
Raw Permalink Normal View History

2021-09-23 11:05:51 +08:00
package event
import "context"
type Consumer struct {
driver DriverInterface
}
func (c *Consumer) Receive(ctx context.Context) *Event {
return c.driver.Get()
}
func NewConsumer(driver DriverInterface) ConsumerInterface {
return &Consumer{
driver: driver,
}
}