Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
oze4 committed Oct 13, 2020
1 parent bcec50d commit 497f46a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,24 @@ wp.SubmitXT(wpxt.Job{
// Required to set global/default
// timeout when calling `New(...)`
myDefaultTimeout := time.Duration(time.Second*30)
wp := wpxt.New(10, myDefaultTimeout)

// Or supply per job - if a job has a timeout,
// it overrides the default
wp.SubmitXT(wpxt.Job{
Name: "Job timeouts",
// Set timeout field on job
Timeout: time.Duration(time.Millisecond*500),
Task: func(o wpxt.Options) wpxt.Response { /* ... */ },
Timeout: time.Duration(time.Millisecond*500), // <---
Task: func(o wpxt.Options) wpxt.Response {
// ...
},
})
```

### Retry

- Optional
- Seamlessly retry failed jobs
- Optional to provide a Retry int per job

```golang
wp.SubmitXT(wpxt.Job{
Expand Down

0 comments on commit 497f46a

Please sign in to comment.