Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrency option ignored in local dev #106

Closed
daguej opened this issue Nov 8, 2023 · 1 comment
Closed

Concurrency option ignored in local dev #106

daguej opened this issue Nov 8, 2023 · 1 comment

Comments

@daguej
Copy link
Contributor

daguej commented Nov 8, 2023

The defer client ignores the concurrency setting when executing jobs locally, and instead immediately invokes the handler function unconditionally, regardless of how many other invocations of the handler are already running.

defer.client/src/index.ts

Lines 104 to 109 in 301f78e

debug(`[defer.run][${originalFunction.name}] defer ignore, no token found.`);
const id = randomUUID();
__database.set(id, { id: id, state: "started" });
execLocally(id, originalFunction, functionArguments);
return { id };

Proper concurrency control is critical to my use case, and it's impossible to develop and test my code if this option does not work.

It would not be hard for the client to maintain an in-memory queue in order to ensure that only concurrency invocations of a job run at a time in dev.

This missing functionality is also not documented anywhere in the local dev docs or concurrency option docs.

@gearnode
Copy link
Member

Fixed in the v2.0.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants