subscriber.go 269 B

123456789101112131415
  1. package broker
  2. import (
  3. "context"
  4. )
  5. type HandleFunc func(ctx context.Context, e *Event) error
  6. type Subscriber interface {
  7. ID() string
  8. HasTopic(topic string) bool
  9. OnAttach() (err error)
  10. Process(ctx context.Context, e *Event) (err error)
  11. OnDetach() (err error)
  12. }