Skip to content

Conversation

@rymurr
Copy link
Contributor

@rymurr rymurr commented Nov 27, 2024

We have a use case where we want to mock a redis queue in testing by using a memqueue. Our code calls https://github.com/vmihailenco/taskq/blob/v3/consumer.go#L314 which fails if the consumer is already started so we want to init our memqueue w/o starting the consumer.

We tried using https://github.com/vmihailenco/taskq/blob/v3/consumer.go#L202 immediately after we created the memqueue but this sometimes takes a very long time in our CI causing spurious flaky tests.

This change is meant to be the smallest possible change to suit our needs and not change the taskq api. Happy to re-work if you have a better suggested path to solve our use case.

@lilien1010 lilien1010 merged commit 0a8b248 into vmihailenco:v3 Apr 28, 2025
4 checks passed
@lilien1010
Copy link
Collaborator

@rymurr
Copy link
Contributor Author

rymurr commented Apr 28, 2025

takign a look

@rymurr
Copy link
Contributor Author

rymurr commented Apr 28, 2025

@lilien1010 can you try to re-trigger? I've ran locally on my machine several times (-count=10) and wasn't able to reproduce

@ostiwe
Copy link

ostiwe commented Jul 27, 2025

Sorry, but it seems to me that these changes do not solve the problem described in the title.

In fact, when a new queue is created, the NewQueue method will be called, in which NewQueueMaybeConsumer is called, with the parameter true - always.

In other words, they simply created another method here that is not called anywhere else.

Or did I not quite understand the meaning correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants