2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-12-27 08:12:19 +08:00
asynq/tools/asynq
Ken Hibino c9a6ab8ae1 Support delete and archive actions on PendingTask
* Add `DeleteAllPendingTasks`, `ArchiveAllPendingTasks` to `Inspector`

* `DeleteTaskByKey` and `ArchiveTaskByKey` now supports deleting/archiving PendingTask

* Updated `asynq task` command with support for deleting/archiving pending tasks
2021-01-31 06:09:40 -08:00
..
cmd Support delete and archive actions on PendingTask 2021-01-31 06:09:40 -08:00
main.go Rename CLI to asynq 2020-04-19 08:51:17 -07:00
README.md Rename DeadTask to ArchivedTask and action "kill" to "archive" 2021-01-14 06:43:44 -08:00

Asynq CLI

Asynq CLI is a command line tool to monitor the queues and tasks managed by asynq package.

Table of Contents

Installation

In order to use the tool, compile it using the following command:

go get github.com/hibiken/asynq/tools/asynq

This will create the asynq executable under your $GOPATH/bin directory.

Usage

Commands

To view details on any command, use asynq help <command> <subcommand>.

  • asynq stats
  • asynq queue [ls inspect history rm pause unpause]
  • asynq task [ls cancel delete archive run delete-all archive-all run-all]
  • asynq server [ls]

Global flags

Asynq CLI 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. To connect to a redis cluster, pass --cluster and --cluster_addrs flags.

By default, CLI will try to connect to a redis server running at localhost:6379.

      --config string          config file to set flag defaut values (default is $HOME/.asynq.yaml)
  -n, --db int                 redis database number (default is 0)
  -h, --help                   help for asynq
  -p, --password string        password to use when connecting to redis server
  -u, --uri string             redis server URI (default "127.0.0.1:6379")

      --cluster                connect to redis cluster
      --cluster_addrs string   list of comma-separated redis server addresses

Config File

You can use a config file to set default values for the flags.

By default, asynq will try to read config file located in $HOME/.asynq.(yml|json). You can specify the file location via --config flag.

Config file example:

uri: 127.0.0.1:6379
db: 2
password: mypassword

This will set the default values for --uri, --db, and --password flags.