rogierschouten/async-lock

Is it ok to make lock.queues public knowledge?

Closed this issue · 3 comments

I am working on a detecting if there are pending tasks on a queue, so I checked lock.queues. However we don't make this public knoweldge so it's implementation detail right now. Is it ok to pr to make this public and kind of a contract that we stick to?

If I were you, I would maintain that in a separate variable. This package is rather hard to change (low code and test quality)

Thanks for your fast reply. So to do that I would have to maintain a queue of my own right? Wouldn't that put two sources of truth. Like it would be hard for me to know when to remove from my queue?

You'd have to maintain a map, not a queue. Otherwise you'd have to mimick async locks behavior exactly and you don't want that