DirtyHairy / async-mutex

A mutex for synchronizing async workflows in Javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A small improvement

ironbone opened this issue · comments

The
runExclusive()
takes as a parameter a function which returns a Promise.
Why not enable also to call this method with just a Promise?

Hi @ironbone !

I am not quite clear what you want to achieve here. runExclusive will schedule the supplied callback to run once the mutex becomes available. What should the effect of calling runExclusive with just a promise be?

Cheers
-Christian

Sorry - I was to fast thinking. It will have no sens. Sorry.

No worries 😏

Is there any way to pass data into mutex.acquire? I need to call this url with a different offset 1392 times. https://www.ncdc.noaa.gov/cdo-web/api/v2/stations?limit=${blk_length}&offset=${offset}