Skip to content

Instantly share code, notes, and snippets.

@rishabh-gupta2
Created March 30, 2021 11:57
Show Gist options
  • Save rishabh-gupta2/c1750be2924db8cc77f294197424dd4e to your computer and use it in GitHub Desktop.
Save rishabh-gupta2/c1750be2924db8cc77f294197424dd4e to your computer and use it in GitHub Desktop.
Outboxer interface
type Outboxer interface {
// Send expects an active gorm transaction alongwith
// a registered JobHandler and creates a new outbox job.
Send(context.Context, *gorm.DB, JobHandler) error
// Start initiates fetcher and processor goroutines to pick up and
// process persisted outbox jobs.
Start(context.Context)
// Stop gracefully terminates all the outbox goroutines.
Stop(context.Context)
// RegisterJobHandler registers JobHandler structs.
RegisterJobHandler(JobHandler) error
// RegisterMetrics expects a prometheus registerer and is used
// to register outbox metrics.
RegisterMetrics(registerer prometheus.Registerer) error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment