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

Implement a controlled task scheduler #9

Open
pior opened this issue Dec 17, 2015 · 0 comments
Open

Implement a controlled task scheduler #9

pior opened this issue Dec 17, 2015 · 0 comments

Comments

@pior
Copy link
Owner

pior commented Dec 17, 2015

To run a high number of concurrent Lambda tasks we need a way to:

  1. limit concurrent running task
  2. limit max task scheduling per decision task

Naive implementation of 1.

def schedule_tasks(self, tasks, max_concurrent=1):
    running_tasks = 0
    for task in tasks:
        if running_task >= max_concurrent:
            self.context.decision_done()
        if not task.done:
            task.schedule()
            running_task += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant