diff --git a/README.md b/README.md index ebe915b..5d4f3d9 100644 --- a/README.md +++ b/README.md @@ -18,19 +18,23 @@ Simple and efficent asynchronous task processing library in Go. ## Overview +![Gif](/docs/assets/asynqmon_stats.gif) + Asynq provides a simple interface to asynchronous task processing. -Asynq also ships with a CLI to monitor the queues and take manual actions if needed. +It also ships with a tool to monitor the queues and take manual actions if needed. Asynq provides: - Clear separation of task producer and consumer - Ability to schedule task processing in the future - Automatic retry of failed tasks with exponential backoff +- Automatic failover using Redis sentinels - Ability to configure max retry count per task - Ability to configure max number of worker goroutines to process tasks -- Unix signal handling to safely shutdown background processing -- CLI to query and mutate queues state for mointoring and administrative purposes +- Support for priority queues +- Unix signal handling to gracefully shutdown background processing +- CLI tool to query and mutate queues state for mointoring and administrative purposes ## Requirements @@ -53,7 +57,8 @@ go get -u github.com/hibiken/asynq import "github.com/hibiken/asynq" ``` -2. Use one of `RedisConnOpt` types to specify how to connect to Redis. +2. Asynq uses redis as a message broker. + Use one of `RedisConnOpt` types to specify how to connect to Redis. ```go var redis = &asynq.RedisClientOpt{ @@ -154,7 +159,13 @@ func main() { ## Monitoring CLI -TODO(hibiken): Describe basic usage of `asynqmon` CLI +Asynq ships with a CLI tool to inspect the state of queues and tasks. + +To install the CLI, run the following command: + + go get github.com/hibiken/asynq/tools/asynqmon + +For details on how to use the tool, see the [README](/tools/asynqmon/README.md) for the asynqmon CLI. ## Acknowledgements diff --git a/docs/assets/asynqmon_stats.gif b/docs/assets/asynqmon_stats.gif new file mode 100644 index 0000000..9d449a6 Binary files /dev/null and b/docs/assets/asynqmon_stats.gif differ diff --git a/tools/asynqmon/README.md b/tools/asynqmon/README.md new file mode 100644 index 0000000..e1e359e --- /dev/null +++ b/tools/asynqmon/README.md @@ -0,0 +1,31 @@ +# Asynqmon + +Asynqmon is a CLI tool to monitor the queues managed by `asynq` package. + +In order to use the tool, compile it using the following command: + + go get github.com/hibiken/asynq/tools/asynqmon + +This will create the asynqmon executable under your `$GOPATH/bin` directory. + +## Quick Start + +Asynqmon tool has a few commands to inspect the state of tasks and queues. + +Run `asynqmon help` to see all the available commands. + +Asynqmon needs to connect to a redis-server to inspect the state of queues and tasks. Use flags to specify the options to connect to the redis-server used by your application. + +By default, Asynqmon will try to connect to a redis server running at `localhost:6379`. + +### Stats + +Stats command gives the overview of the current state of tasks and queues. Run it in conjunction with `watch` command to repeatedly run `stats`. + +Example: + + watch -n 3 asynqmon stats + +This will run `asynqmon stats` command every 3 seconds. + +![Gif](/docs/assets/asynqmon_stats.gif)