add job name to event listners (#621)

* add job name to event listners

* missed the examples

* missed executor
This commit is contained in:
John Roesler
2023-11-14 11:39:27 -06:00
committed by GitHub
parent 66caa1aabe
commit 8c628fae2d
5 changed files with 25 additions and 25 deletions
+6 -6
View File
@@ -23,7 +23,7 @@ func ExampleAfterJobRuns() {
),
WithEventListeners(
AfterJobRuns(
func(jobID uuid.UUID) {
func(jobID uuid.UUID, jobName string) {
// do something after the job completes
},
),
@@ -44,7 +44,7 @@ func ExampleAfterJobRunsWithError() {
),
WithEventListeners(
AfterJobRunsWithError(
func(jobID uuid.UUID, err error) {
func(jobID uuid.UUID, jobName string, err error) {
// do something when the job returns an error
},
),
@@ -65,7 +65,7 @@ func ExampleBeforeJobRuns() {
),
WithEventListeners(
BeforeJobRuns(
func(jobID uuid.UUID) {
func(jobID uuid.UUID, jobName string) {
// do something immediately before the job is run
},
),
@@ -464,17 +464,17 @@ func ExampleWithEventListeners() {
),
WithEventListeners(
AfterJobRuns(
func(jobID uuid.UUID) {
func(jobID uuid.UUID, jobName string) {
// do something after the job completes
},
),
AfterJobRunsWithError(
func(jobID uuid.UUID, err error) {
func(jobID uuid.UUID, jobName string, err error) {
// do something when the job returns an error
},
),
BeforeJobRuns(
func(jobID uuid.UUID) {
func(jobID uuid.UUID, jobName string) {
// do something immediately before the job is run
},
),