From 74e5582cfc12ece1883d75353b2c7277a536b581 Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Sat, 18 Apr 2020 08:03:58 -0700 Subject: [PATCH] Update readme --- README.md | 10 +++++----- tools/asynq/README.md | 10 ++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0f902c2..26672b9 100644 --- a/README.md +++ b/README.md @@ -112,8 +112,8 @@ func HandleImageProcessingTask(ctx context.Context, t *asynq.Task) error { } ``` -In your web application code, import the above package and use [`Client`](https://pkg.go.dev/github.com/hibiken/asynq?tab=doc#Client) to enqueue tasks to the task queue. -A task will be processed by a background worker as soon as the task gets enqueued. +In your web application code, import the above package and use [`Client`](https://pkg.go.dev/github.com/hibiken/asynq?tab=doc#Client) to put tasks on the queue. +A task will be processed asynchronously by a background worker as soon as the task gets enqueued. Scheduled tasks will be stored in Redis and will be enqueued at the specified time. ```go @@ -129,7 +129,7 @@ import ( const redisAddr = "127.0.0.1:6379" func main() { - r := &asynq.RedisClientOpt{Addr: redisAddr} + r := asynq.RedisClientOpt{Addr: redisAddr} c := asynq.NewClient(r) // Example 1: Enqueue task to be processed immediately. @@ -151,7 +151,7 @@ func main() { // Example 3: Pass options to tune task processing behavior. - // Options include MaxRetry, Queue, Timeout, Deadline, etc. + // Options include MaxRetry, Queue, Timeout, Deadline, Unique etc. t = tasks.NewImageProcessingTask("some/blobstore/url", "other/blobstore/url") err = c.Enqueue(t, asynq.MaxRetry(10), asynq.Queue("critical"), asynq.Timeout(time.Minute)) @@ -177,7 +177,7 @@ import ( const redisAddr = "127.0.0.1:6379" func main() { - r := &asynq.RedisClientOpt{Addr: redisAddr} + r := asynq.RedisClientOpt{Addr: redisAddr} srv := asynq.NewServer(r, asynq.Config{ // Specify how many concurrent workers to use diff --git a/tools/asynq/README.md b/tools/asynq/README.md index efa02de..a81bfbe 100644 --- a/tools/asynq/README.md +++ b/tools/asynq/README.md @@ -8,7 +8,7 @@ Asynq CLI is a command line tool to monitor the tasks managed by `asynq` package - [Quick Start](#quick-start) - [Stats](#stats) - [History](#history) - - [Process Status](#process-status) + - [Servers](#servers) - [List](#list) - [Enqueue](#enqueue) - [Delete](#delete) @@ -58,15 +58,13 @@ Example: ![Gif](/docs/assets/asynq_history.gif) -### Process Status +### Servers -PS (ProcessStatus) command shows the list of running worker processes. +Servers command shows the list of running worker servers pulling tasks from the given redis instance. Example: - asynq ps - -![Gif](/docs/assets/asynq_ps.gif) + asynq servers ### List