-
Notifications
You must be signed in to change notification settings - Fork 611
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
Added withDeadline modifier #7299
base: main
Are you sure you want to change the base?
Changes from 11 commits
b3f9775
74b22ea
b53f8c3
9a9766f
928945a
3216b96
b903bfe
47359e5
0101552
f98f327
89b7994
730e114
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,6 +309,16 @@ class Command : public wpi::Sendable, public wpi::SendableHelper<Command> { | |
[[nodiscard]] | ||
CommandPtr OnlyIf(std::function<bool()> condition) &&; | ||
|
||
/** | ||
* Creates a new command that runs this command | ||
* and the deadline in parallel, finishing when | ||
* the deadline finishes. | ||
* | ||
* @param deadline the deadline of the command group | ||
* @return the decorated command | ||
*/ | ||
Comment on lines
+312
to
+319
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Open question: Do we want to include an explicit note that the calling command will be interrupted when the other command finishes? (This would make it match more with (Both of these apply to Java, by the way) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense; i'll get around to it soon |
||
CommandPtr WithDeadline(CommandPtr&& deadline) &&; | ||
|
||
/** | ||
* Decorates this command with a set of commands to run parallel to it, ending | ||
* when the calling command ends and interrupting all the others. Often more | ||
|
@@ -321,6 +331,7 @@ class Command : public wpi::Sendable, public wpi::SendableHelper<Command> { | |
*/ | ||
[[nodiscard]] | ||
CommandPtr DeadlineFor(CommandPtr&& parallel) &&; | ||
|
||
/** | ||
* Decorates this command with a set of commands to run parallel to it, ending | ||
* when the last command ends. Often more convenient/less-verbose than | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe it was something that came up when attempting to merge from main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to have been a weird interaction between the merge and the formatting. Just manually add the line back to clean up the PR diff.