Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] RDB and Inspector support Go contexts #488

Open
xuyang2 opened this issue Jun 13, 2022 · 1 comment · May be fixed by #494
Open

[FEATURE REQUEST] RDB and Inspector support Go contexts #488

xuyang2 opened this issue Jun 13, 2022 · 1 comment · May be fixed by #494
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@xuyang2
Copy link
Contributor

xuyang2 commented Jun 13, 2022

Is your feature request related to a problem? Please describe.
Is it acceptable to add a ctx context.Context parameter to some RDB and Inspector methods, for deadline, cancellation and observability(otel).

Describe the solution you'd like

Take Inspector.Queues() for example:

// QueuesContext returns a list of all queue names.
func (i *Inspector) QueuesContext(ctx context.Context) ([]string, error) {
	return i.rdb.AllQueuesContext(ctx)
}

// Queues returns a list of all queue names.
func (i *Inspector) Queues() ([]string, error) {
	return i.QueuesContext(context.Background())
}
// AllQueuesContext returns a list of all queue names.
func (r *RDB) AllQueuesContext(ctx context.Context) ([]string, error) {
	return r.client.SMembers(ctx, base.AllQueues).Result()
}

// AllQueues returns a list of all queue names.
func (r *RDB) AllQueues() ([]string, error) {
	return r.AllQueuesContext(context.Background())
}

I can make a PR if this is acceptable.

@xuyang2 xuyang2 added the enhancement New feature or request label Jun 13, 2022
@hibiken
Copy link
Owner

hibiken commented Jun 18, 2022

@xuyang2 Yes I think it makes sense to support context for all inspector operations. Please feel free to create a PR!

@hibiken hibiken added the good first issue Good for newcomers label Jun 18, 2022
@xuyang2 xuyang2 linked a pull request Jun 21, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants