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

Feature/update priority

Open RaishavHanspal opened this issue 1 year ago • 4 comments

#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 avatar Jul 11 '24 18:07 RaishavHanspal

requested changes have been pushed! @Richienb

RaishavHanspal avatar Jul 19 '24 14:07 RaishavHanspal

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?

Richienb avatar Jul 27 '24 02:07 Richienb

@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 avatar Jul 27 '24 04:07 RaishavHanspal

@Richienb, @sindresorhus , Please suggest further.

RaishavHanspal avatar Aug 09 '24 07:08 RaishavHanspal

Needs to be added to the readme.

I would like to see some more tests.

And the pull request needs a proper title.

sindresorhus avatar Nov 18 '24 09:11 sindresorhus

index.d.ts and readme should be in sync, specifically setPriority

sindresorhus avatar Nov 27 '24 09:11 sindresorhus

Ok @sindresorhus ! would you suggest I add the code snippets as well in the json doc comment just as we have in the readme? Or please suggest otherwise. 🙂

RaishavHanspal avatar Nov 27 '24 10:11 RaishavHanspal

Yes

sindresorhus avatar Nov 27 '24 10:11 sindresorhus