[PR #577] [CLOSED] Add interface for Inspector methods #1791

Closed
opened 2026-03-07 22:13:15 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hibiken/asynq/pull/577
Author: @vladfr
Created: 11/23/2022
Status: Closed

Base: masterHead: inspector_interface


📝 Commits (2)

  • 3481165 create an interface for inspector methods
  • 840abd1 fix errors in tests

📊 Changes

5 files changed (+222 additions, -153 deletions)

View changed files

📝 inspector.go (+9 -9)
📝 internal/base/base.go (+84 -0)
internal/base/stats.go (+67 -0)
📝 internal/rdb/inspect.go (+23 -105)
📝 internal/rdb/inspect_test.go (+39 -39)

📄 Description

This is a code structure change, not a functional one. There is a base.Broker interface that RDB implements, so I wanted to do the same for the Inspector.

This PR adds the interface base.QueueInspector and moves some types to the base package in order to avoid circular dependencies. As expected, RDB already implements both base.QueueInspector and base.Broker.

Why?. To make the CLI and UI work with different broker implementations. I would like to add another broker to this library, backed by MongoDB. base.Broker works fine, I have implemented basic features, but it needs this new interface to add support in the CLI and UI.

All tests are passing.


🔄 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/577 **Author:** [@vladfr](https://github.com/vladfr) **Created:** 11/23/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `inspector_interface` --- ### 📝 Commits (2) - [`3481165`](https://github.com/hibiken/asynq/commit/34811656f2a053cb271acafe317ef6c1d78cca63) create an interface for inspector methods - [`840abd1`](https://github.com/hibiken/asynq/commit/840abd161d530849c37b84d94200ce20b62b766f) fix errors in tests ### 📊 Changes **5 files changed** (+222 additions, -153 deletions) <details> <summary>View changed files</summary> 📝 `inspector.go` (+9 -9) 📝 `internal/base/base.go` (+84 -0) ➕ `internal/base/stats.go` (+67 -0) 📝 `internal/rdb/inspect.go` (+23 -105) 📝 `internal/rdb/inspect_test.go` (+39 -39) </details> ### 📄 Description This is a code structure change, not a functional one. There is a `base.Broker` interface that RDB implements, so I wanted to do the same for the Inspector. This PR adds the interface `base.QueueInspector` and moves some types to the `base` package in order to avoid circular dependencies. As expected, RDB already implements both `base.QueueInspector` and `base.Broker`. **Why?**. To make the CLI and UI work with different broker implementations. I would like to add another broker to this library, backed by MongoDB. `base.Broker` works fine, I have implemented basic features, but it needs this new interface to add support in the CLI and UI. All tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-07 22:13:15 +03:00
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#1791
No description provided.