Created
March 30, 2021 11:54
-
-
Save rishabh-gupta2/37ca0e7d212603ba74d0de1b1a02c438 to your computer and use it in GitHub Desktop.
JobHandler interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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