durable-queue icon indicating copy to clipboard operation
durable-queue copied to clipboard

Less durable queue

Open jakepearson opened this issue 10 years ago • 5 comments

Would it be possible to create a version of the queue that would not be durable for testing purposes? Maybe you could pass an optional parameter to set it to in memory on mode.

jakepearson avatar Apr 08 '14 19:04 jakepearson

What are you trying to test? You could simply set the :fsync-intervalto be arbitrarily high, but it will still fsync when swapping out slab files.

ztellman avatar Apr 08 '14 19:04 ztellman

The idea was to isolate queues between tests, I would like to be sure that one test's queue state cannot effect another. I can use a uuid for a queue name for each test, but over time I would end up with a large directory. If I can keep the queue in memory then I won't need to make sure to use a uuid or cleanup a named queue between test runs.

jakepearson avatar Apr 08 '14 19:04 jakepearson

I can provide a delete-queues function, if that helps, but I suggest actually exercising the code in your tests is a good idea. Skipping over writing to disk would also skip over serializing the tasks, which is an important thing to validate.

ztellman avatar Apr 08 '14 19:04 ztellman

That sounds great. Thanks.

jakepearson avatar Apr 08 '14 20:04 jakepearson

This issue can be safely closed at the delete! functionality has been added to the code via 37e31d3214773fa1a731af8dca0c34007a93295b 9 years ago.

vedang avatar May 02 '23 06:05 vedang