Files
micromdm/pubsub/pubsub.go
Victor Vrantchan 20689679ae move pubsub inmem to subpackage (#210)
Split types from implementation to support multiple pubsub types in the near future.
2017-06-14 01:23:58 -04:00

22 lines
346 B
Go

package pubsub
import "context"
type Event struct {
Topic string
Message []byte
}
type Publisher interface {
Publish(ctx context.Context, topic string, msg []byte) error
}
type Subscriber interface {
Subscribe(ctx context.Context, name, topic string) (<-chan Event, error)
}
type PublishSubscriber interface {
Publisher
Subscriber
}