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

Explain locking and link to example #795

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

dandv
Copy link
Contributor

@dandv dandv commented Mar 29, 2019

I hope examples will greatly help newcomers understand how Agenda works!

@@ -283,6 +283,16 @@ const agenda = new Agenda({maxConcurrency: 20});
Takes a `number` which specifies the default number of a specific job that can be running at
any given moment. By default it is `5`.

The concurrency parameter is only important when the job takes longer than its
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this is incorrect. Gonna throw together a minimal repo to try and confirm.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've thrown this together: https://github.com/wingsbob/agenda-concurrency-example

You can run with different default concurrency levels by setting the environment variable CONCURRENCY. The lock time is left as the default (10 mins), so that's definitely not coming into effect.

Agenda#every might not be the best example for concurrency, as it creates single type jobs, which seem to be semi-unique


* Multiple queues don't process the same job
* The same job doesn't get run again before it has finished. For example, if a job
is scheduled to run [`every`](#everyinterval-name-data-options-cb) 5 seconds but
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use Job#repeatEvery for this example

@OmgImAlexis
Copy link
Member

Is this able to be updated or should we close this?

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

Successfully merging this pull request may close these issues.

None yet

4 participants