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

dynamic scheduling #11

Open
jupe opened this issue Nov 13, 2015 · 1 comment
Open

dynamic scheduling #11

jupe opened this issue Nov 13, 2015 · 1 comment

Comments

@jupe
Copy link

jupe commented Nov 13, 2015

I would like to manage scheduling dynamically, so that new resources and tasks appear/disappear on the fly.

something like:

var scheduler = schedule.create(initial_tasks, initial_resources, null, start);
setInterval( function() {
     //add one more task every 1 second
    scheduler.add_task(..)
}, 1000);
setInterval( function() {
     //add one more resource every 5 second
     scheduler.add_resource()
     //remove one resource from resources pool
     scheduler.remove_resource(<id>)
}, 5000);

for(var task in scheduler.get_next_scheduled_task()) {
    ...
}

Is this already possible, and if not, how much it needs effort to implement this kind of feature ?

@bunkat
Copy link
Owner

bunkat commented Nov 13, 2015

Every time you call schedule.create(tasks, resources); it creates a schedule based on what is currently specified. Every time you add a resource or task, you should just reschedule everything. If you are looking for the next schedule task, you would just pick the task with the earliest start date.

If you knew more about the tasks and resources, you could just reschedule the tasks that were affected by the change that was made, but unless you are dealing with thousands of tasks, rescheduling everything every second shouldn't be a problem.

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

No branches or pull requests

2 participants