sindresorhus / p-queue

Promise queue with concurrency control
MIT License
3.39k stars 182 forks source link

Feature/update priority #209

Open RaishavHanspal opened 1 month ago

RaishavHanspal commented 1 month ago

208 - add a uid to track the promise functions and update the priority on any promise.

also add a new event started to notify when a promise function is executed.

RaishavHanspal commented 1 month ago

requested changes have been pushed! @Richienb

Richienb commented 1 month ago

I think we should allow searching by the object returned by enqueue as well. What do you think? Does there remain a use case where a string id remains more useful?

RaishavHanspal commented 1 month ago

@Richienb that would be a very nice idea, and will not require id property. The problem that I faced was enqueue accepts RunFunction - which in my understanding is a callback not accessible to the end-user. The Idea of priority update - is for the user to be able to update the priority on the fly, currently this is achieved by a unique id assigned by user, or this can be passed using the invoke event as added in #210 incase assigned by #idAssigner.

RaishavHanspal commented 2 weeks ago

@Richienb, @sindresorhus , Please suggest further.