Skip to content

Instantly share code, notes, and snippets.

@rishabh-gupta2
Created March 30, 2021 11:54
Show Gist options
  • Save rishabh-gupta2/37ca0e7d212603ba74d0de1b1a02c438 to your computer and use it in GitHub Desktop.
Save rishabh-gupta2/37ca0e7d212603ba74d0de1b1a02c438 to your computer and use it in GitHub Desktop.
JobHandler interface
// JobHandler is anything that can be sent using outboxer.
type JobHandler interface {
// Name returns a unique name for each handler.
// Unique name for each handler is a constraint,
// otherwise it will fail at the time of registration.
Name() string
// Handle is responsible for implementation-specific handling of jobs.
// Implementations need to ensure atomicity and graceful handling
// of out-of-order events.
Handle(context.Context) error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment