[PR #976] feat: allow custom Redis-like broker #2979

Open
opened 2026-03-15 21:13:39 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hibiken/asynq/pull/976
Author: @asdfhuang
Created: 12/3/2024
Status: 🔄 Open

Base: masterHead: feat/custom_broker


📝 Commits (2)

  • 7986156 feat: allow custom broker
  • 6dad2eb feat: exports broker releated types

📊 Changes

8 files changed (+99 additions, -32 deletions)

View changed files

broker/broker.go (+25 -0)
📝 client.go (+8 -1)
📝 internal/base/base.go (+7 -2)
📝 internal/rdb/rdb.go (+28 -3)
📝 internal/rdb/rdb_test.go (+5 -5)
📝 internal/testbroker/testbroker.go (+2 -3)
📝 server.go (+17 -10)
📝 subscriber.go (+7 -8)

📄 Description

This PR decouples Broker interface from redis and allows creating Server and Client directly from a broker instance. Which makes it possible for custom brokers.

For exmaple: Redis from our infrastructure doesn't support pubsub. But I can inherit RDB and implement the pub/sub in another way to make asynq work without a huge amount of work.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hibiken/asynq/pull/976 **Author:** [@asdfhuang](https://github.com/asdfhuang) **Created:** 12/3/2024 **Status:** 🔄 Open **Base:** `master` ← **Head:** `feat/custom_broker` --- ### 📝 Commits (2) - [`7986156`](https://github.com/hibiken/asynq/commit/7986156ac41fd666900056b17872b8ef2ce5e1fd) feat: allow custom broker - [`6dad2eb`](https://github.com/hibiken/asynq/commit/6dad2eb6d7c39a9e912c4914a24c67ee660b24c5) feat: exports broker releated types ### 📊 Changes **8 files changed** (+99 additions, -32 deletions) <details> <summary>View changed files</summary> ➕ `broker/broker.go` (+25 -0) 📝 `client.go` (+8 -1) 📝 `internal/base/base.go` (+7 -2) 📝 `internal/rdb/rdb.go` (+28 -3) 📝 `internal/rdb/rdb_test.go` (+5 -5) 📝 `internal/testbroker/testbroker.go` (+2 -3) 📝 `server.go` (+17 -10) 📝 `subscriber.go` (+7 -8) </details> ### 📄 Description This PR decouples `Broker` interface from redis and allows creating `Server` and `Client` directly from a broker instance. Which makes it possible for custom brokers. For exmaple: Redis from our infrastructure doesn't support pubsub. But I can inherit RDB and implement the pub/sub in another way to make asynq work without a huge amount of work. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#2979
No description provided.