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 ability to reschedule onto the current scheduler #21

Closed
lewissbaker opened this issue Nov 13, 2019 · 0 comments
Closed

Add ability to reschedule onto the current scheduler #21

lewissbaker opened this issue Nov 13, 2019 · 0 comments
Assignees

Comments

@lewissbaker
Copy link
Contributor

Add overloads of the schedule(), schedule_after() algorithms that don't take a scheduler and that use whatever the current scheduler from the receiver is (ie. using get_scheduler() - see #20).

This would simplify writing some kinds of code, like a timeout() algorithm.

template<typename Op, typename Duration>
auto timeout(Op op, Duration duration) {
  return take_until(std::move(op), schedule_after(duration));
}

Whereas currently we'd need to do something like:

template<typename Op, typename Scheduler, typename Duration>
auto timeout(Op op, Scheduler sched, Duration duration) {
  return take_until(std::move(op), schedule_after(sched, duration));
}

Q. Should schedule() be named reschedule()?

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

1 participant