Commit a6a49736 authored by Vojtech Vitek (V-Teq)'s avatar Vojtech Vitek (V-Teq)
Browse files

Improve README examples

parent 6c0caf16
......@@ -17,16 +17,19 @@
jobs, _ := disque.Connect("")
// Enqueue "high" priority job.
job1, _ := jobs.Add(data1, "high")
// Enqueue job with "high" priority.
jobs.Add(data1, "high")
// Enqueue "low" priority jobs.
job2, _ := jobs.TTL(24 * time.Hour).Add(data2, "low")
// Enqueue job with "low" priority (and remove it after 24 hours if not ACKed).
jobs.TTL(24 * time.Hour).Add(data2, "low")
// Enqueue "urgent" priority job. Re-queue if not ACKed within one minute.
job3, err := jobs.RetryAfter(time.Minute).Add(data3, "urgent")
// Enqueue job with "urgent" priority. Consumers will have one minute to Ack() the job after they Get() it, or it will be re-queued.
jobs.RetryAfter(time.Minute).Add(data3, "urgent")
// Enqueue job with "urgent" priority and wait for it to finish.
job4, err := jobs.Add(data4, "urgent")
if err != nil {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment