2021-09-23 11:05:51 +08:00
|
|
|
package event
|
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
|
|
|
type Produce struct {
|
|
|
|
driver DriverInterface
|
|
|
|
}
|
|
|
|
|
2021-10-26 09:29:39 +08:00
|
|
|
func (p *Produce) NewEvent(name string) *event {
|
|
|
|
return p.driver.NewEvent(name)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Produce) Recovery(e *event) {
|
|
|
|
p.driver.Recovery(e)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Produce) Call(ctx context.Context, e *event) {
|
|
|
|
p.driver.Put(e)
|
2021-09-23 11:05:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewProduce(driver DriverInterface) ProduceInterface {
|
|
|
|
return &Produce{
|
|
|
|
driver: driver,
|
|
|
|
}
|
|
|
|
}
|