18 lines
269 B
Go
18 lines
269 B
Go
|
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,
|
||
|
}
|
||
|
}
|