An open API service indexing awesome lists of open source software.

https://github.com/marcuwynu23/onqueue

Onqueue is a lightweight, multithreaded task queue runner built in Rust using Axum. It supports REST API and CLI-based task management, making it ideal for automating shell commands, deployment tasks, and lightweight job queues.
https://github.com/marcuwynu23/onqueue

cmdline command deployment management queue queueing shared task terminal vps

Last synced: 14 days ago
JSON representation

Onqueue is a lightweight, multithreaded task queue runner built in Rust using Axum. It supports REST API and CLI-based task management, making it ideal for automating shell commands, deployment tasks, and lightweight job queues.

Awesome Lists containing this project

README

          


Onqueue



Stars Badge
Forks Badge
Issues Badge
License Badge

**Onqueue** is a lightweight, multithreaded task queue runner built in Rust using [Axum](https://github.com/tokio-rs/axum). It supports REST API and CLI-based task management, making it ideal for automating shell commands, deployment tasks, and lightweight job queues.

---

## ๐Ÿ“ฆ Features

- โœ… Queue tasks with names and commands
- โœ… Web server using Axum with endpoints to add/list tasks
- โœ… CLI support: `onqueue add`, `onqueue list`
- โœ… Multithreaded task runner with retry support
- โœ… Persistent queue file via `queue.yml`
- โœ… JSON API output
- โœ… Automatic retries on failure
- โœ… Configurable apps via `queue-app.yml`

---

## ๐Ÿงฐ Usage

### โ–ถ๏ธ Running the Server

```bash
onqueue serve
```

Server starts on [http://localhost:8080](http://localhost:8080)

---

### ๐ŸŒ API Endpoints

- **GET /** โ€“ Show welcome message
- **GET /list** โ€“ Return current tasks as JSON
- **GET /add?name=app1&cmd=echo+Hello** โ€“ Queue a new task

---

### ๐Ÿ–ฅ๏ธ CLI Usage

#### Add from `queue-app.yml`

```yaml
# queue-app.yml
name: deploy
command: ansible-playbook deploy.yml
```

```bash
onqueue add .
```

#### List tasks

```bash
onqueue list
```

---

## ๐Ÿ“‚ Directory Structure

```
.
โ”œโ”€โ”€ src/
โ”œโ”€โ”€ queue.yml # Stores all queued tasks
โ”œโ”€โ”€ queue-app.yml # CLI-based task configuration
โ”œโ”€โ”€ logs/ # (planned) Directory for task execution logs
โ”œโ”€โ”€ Cargo.toml
โ””โ”€โ”€ README.md
```

---

## ๐Ÿ“– Example

```bash
curl "http://localhost:8080/add?name=build&cmd=echo+Building"
curl "http://localhost:8080/list"
```

Output:

```json
[
{
"name": "build",
"command": "echo Building",
"status": "completed",
"start_time": "2025-04-07T10:00:00Z",
"end_time": "2025-04-07T10:00:01Z",
"retries": 0
}
]
```

---

## ๐Ÿ›ฃ Roadmap

See [FEATURE-TODO-LIST.md](./FEATURE-TODO-LIST.md) for upcoming improvements:

- Logging
- CLI formatting
- Cron-like scheduling
- Persistent task results
- PM2 integration

---

## ๐Ÿงช Development

Install dependencies:

```bash
cargo install --path .
```

Run in dev mode:

```bash
cargo run
```

---

## โš–๏ธ License

MIT ยฉ [Your Name or Org]