You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/cpln-task-runner/README.md
+74-16Lines changed: 74 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Task Dispatcher
2
2
3
-
A **self-hosted task queue and scheduler service** that mimics **Google Cloud Tasks** functionality, built with Go and Redis. This is designed as a drop-in replacement for Cloud Tasks when you want more control, flexibility, or cost savings.
3
+
A **self-hosted task queue and scheduler service** that mimics **Google Cloud Tasks** functionality, built with Go and Redis Sentinel. This is designed as a drop-in replacement for Cloud Tasks when you want more control, flexibility, or cost savings.
4
4
5
5
## Overview
6
6
7
-
Task Dispatcher accepts HTTP requests to enqueue background jobs, stores them in Redis, and processes them asynchronously by making HTTP calls to target endpoints. It supports delayed execution, priority queues, automatic retries, and concurrency control.
7
+
Task Dispatcher accepts HTTP requests to enqueue background jobs, stores them in Redis (via Sentinel for high availability), and processes them asynchronously by making HTTP calls to target endpoints. It supports delayed execution, priority queues, automatic retries, and rate limiting per client.
8
8
9
9
## Features
10
10
@@ -13,15 +13,19 @@ Task Dispatcher accepts HTTP requests to enqueue background jobs, stores them in
The application can be deployed to any platform that supports Docker:
136
183
137
184
1. Build the image: `docker build -t task-dispatcher .`
138
-
2. Deploy Redis with persistence enabled
139
-
3. Set `REDIS_ADDR`environment variable
185
+
2. Deploy Redis Sentinel (see `redis/sentinel` example in this repo)
186
+
3. Set `REDIS_SENTINEL_ADDR` and `REDIS_MASTER_NAME`environment variables
140
187
4. Expose port 8080
141
188
189
+
## Redis Sentinel
190
+
191
+
This application **requires Redis Sentinel** for high availability. It does not support standalone Redis.
192
+
193
+
Redis Sentinel provides:
194
+
-**Automatic master discovery** - workers connect via Sentinel to find the current master
195
+
-**Automatic failover** - if the master fails, Sentinel promotes a replica and workers reconnect automatically
196
+
-**High availability** - no single point of failure for Redis
197
+
198
+
When deploying on Control Plane, use the global internal endpoint for Sentinel (e.g., `redis-sentinel.mygvc.cpln.local:26379`) which load balances across all Sentinel replicas.
0 commit comments