From 497f46af0173dc5cb4264da4a8c1161eca4ed9f3 Mon Sep 17 00:00:00 2001 From: Matt Oestreich Date: Mon, 12 Oct 2020 19:36:06 -0500 Subject: [PATCH] Update README.md --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 79bb23d..6bbf149 100644 --- a/README.md +++ b/README.md @@ -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{