Versions in this module Expand all Collapse all v0 v0.15.6 Jun 13, 2022 Changes in this version + var PeriodicCleanupAge = 10 * time.Minute + var PeriodicSweepAge = 15 * time.Second + var PeriodicSweepInterval = 15 * time.Second + func NewGracefulContext(ctx context.Context, idle, forceAfter time.Duration) (c context.Context, keepAlive func(), cancel func()) + type GracefulContext struct + func (g *GracefulContext) Done() <-chan struct{} + type Option func(*Outbox) error + func WithWatchToken(token string) Option + type Outbox struct + func NewOutbox(uri, dbName string, options ...Option) (*Outbox, error) + func NewOutboxWithClient(client *mongo.Client, dbName string, options ...Option) (*Outbox, error) + func (o *Outbox) AddHandler(ctx context.Context, m eh.EventMatcher, h eh.EventHandler) error + func (o *Outbox) Client() *mongo.Client + func (o *Outbox) Close() error + func (o *Outbox) Errors() <-chan error + func (o *Outbox) HandleEvent(ctx context.Context, event eh.Event) error + func (o *Outbox) HandlerType() eh.EventHandlerType + func (o *Outbox) Start()