forked from p93542168/wheat-cache
26 lines
333 B
Go
26 lines
333 B
Go
package event
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type eventType int8
|
|
|
|
const (
|
|
normalEvent = eventType(iota)
|
|
waitEvent
|
|
)
|
|
|
|
type DriverInterface interface {
|
|
Get() *Event
|
|
Put(event *Event)
|
|
}
|
|
|
|
type ProduceInterface interface {
|
|
Call(ctx context.Context, event *Event)
|
|
}
|
|
|
|
type ConsumerInterface interface {
|
|
Receive(ctx context.Context) *Event
|
|
}
|