https://github.com/tinh-tinh/queue
🛢 Queu Module for Tinh Tinh
https://github.com/tinh-tinh/queue
framework queue redis
Last synced: 3 months ago
JSON representation
🛢 Queu Module for Tinh Tinh
- Host: GitHub
- URL: https://github.com/tinh-tinh/queue
- Owner: tinh-tinh
- License: mit
- Created: 2024-09-10T10:08:37.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-10-20T14:07:08.000Z (6 months ago)
- Last Synced: 2025-10-20T15:35:26.631Z (6 months ago)
- Topics: framework, queue, redis
- Language: Go
- Homepage: https://tinh-tinh.github.io/docs/docs/intergrations/queue
- Size: 107 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Queue Module for Tinh Tinh
## Overview
The Queue module provides a robust, Redis-based job queue for the Tinh Tinh framework, supporting job scheduling, rate limiting, retries, concurrency, delayed jobs, priorities, and more.
## Install
```bash
go get -u github.com/tinh-tinh/queue/v2
```
## Features
- **Redis-Based:** Robust persistence and distributed processing.
- **Delayed Jobs:** Schedule jobs to run after a delay.
- **Cron Scheduling:** Schedule and repeat jobs using cron patterns.
- **Rate Limiting:** Control job processing rate.
- **Retries:** Automatic retry on failure.
- **Priority:** Job prioritization.
- **Concurrency:** Multiple workers per queue.
- **Pause/Resume:** Temporarily stop and resume job processing.
- **Crash Recovery:** Recovers jobs after process crashes.
- **Remove on Complete/Fail:** Clean up jobs after handling.
## Quick Start
### 1. Register the Module
```go
import "github.com/tinh-tinh/queue/v2"
queueModule := queue.ForRoot(&queue.Options{
Connect: &redis.Options{
Addr: "localhost:6379",
DB: 0,
},
Workers: 3,
RetryFailures: 3,
})
```
Or via factory:
```go
queueModule := queue.ForRootFactory(func(ref core.RefProvider) *queue.Options {
return &queue.Options{ /* ... */ }
})
```
### 2. Register and Inject Queues
```go
userQueueModule := queue.Register("user") // uses default/global options
// In your service or controller:
userQueue := queue.Inject(module, "user")
```
## Contributing
We welcome contributions! Please feel free to submit a Pull Request.
## Support
If you encounter any issues or need help, you can:
- Open an issue in the GitHub repository
- Check our documentation
- Join our community discussions