forked from p93542168/wheat-cache
22 lines
343 B
Go
22 lines
343 B
Go
|
package event2
|
||
|
|
||
|
import "context"
|
||
|
|
||
|
type Produce struct {
|
||
|
driver DriverInterface
|
||
|
}
|
||
|
|
||
|
func (p *Produce) NewEvent(name string) *event {
|
||
|
return p.driver.NewEvent(name)
|
||
|
}
|
||
|
|
||
|
func (p *Produce) Call(ctx context.Context, e *event) {
|
||
|
p.driver.Put(e)
|
||
|
}
|
||
|
|
||
|
func NewProduce(driver DriverInterface) ProduceInterface {
|
||
|
return &Produce{
|
||
|
driver: driver,
|
||
|
}
|
||
|
}
|