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

Add work queue #430

Merged
merged 2 commits into from
Nov 7, 2019
Merged

Add work queue #430

merged 2 commits into from
Nov 7, 2019

Conversation

jcmoraisjr
Copy link
Owner

@jcmoraisjr jcmoraisjr commented Oct 28, 2019

A work queue is used to start workloads asynchronously. The workload itself always run once at a time.

Use cases:

  • parsing ingress: the ingress parser and config builder is a workload which runs when the k8s state changes
  • acme signer: a v0.9 feature, sign a new certificate is a workload which runs when a new certificate need to be issued

Progress:

  • work queue
  • rate limit
  • unit tests

A work queue is used to start workloads asynchronously. The workload itself always run once at a time.

Use cases:

* parsing ingress: the ingress parser and config builder is a workload which runs when the k8s state changes
* acme signer: a v0.9 feature, sign a new certificate is a workload which runs when a new certificate need to be issued
Rate limit is a mandatory argument on `NewQueue()`, if greater than 0 will configure a rate limiting control to call sync.

Every single call to `Add()` is rate limited before calling `sync()`. Use `Notify()` instead if a single/global rate limit should be used instead one per added item.
@jcmoraisjr jcmoraisjr changed the title WIP: Add work queue Add work queue Nov 3, 2019
@jcmoraisjr jcmoraisjr merged commit 1b55c3c into master Nov 7, 2019
@jcmoraisjr jcmoraisjr deleted the jm-queue branch November 7, 2019 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant