You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The current interruption behavior logic is a black and white "This command can be canceled" or "This command can't be canceled". This can be an issue especially if you have complex command logic and want to enforce certain rules on when certain commands can be scheduled.
Describe the solution you'd like Command.getInterruptionBehavior gets a parameter that is the incoming command.
public InterruptionBehavior getInterruptionBehavior(Command incomingCommand) {
return InterruptionBehavior.kCancelSelf;
}
This allows the currently running command to decide if it should cancel or not. This is nice for when you want to enforce a command hierarchy without having to have extra code at every schedule site.
Command.withInterruptionBehavior would take in a Function<Command,InterruptionBehavior> instead of just InterruptionBehavior.
Additional context #6510 would help this a lot as it would be easier to identify which commands should cancel the current command.
Is your feature request related to a problem? Please describe.
The current interruption behavior logic is a black and white "This command can be canceled" or "This command can't be canceled". This can be an issue especially if you have complex command logic and want to enforce certain rules on when certain commands can be scheduled.
Describe the solution you'd like
Command.getInterruptionBehavior
gets a parameter that is the incoming command.This allows the currently running command to decide if it should cancel or not. This is nice for when you want to enforce a command hierarchy without having to have extra code at every schedule site.
Command.withInterruptionBehavior
would take in aFunction<Command,InterruptionBehavior>
instead of justInterruptionBehavior
.Additional context
#6510 would help this a lot as it would be easier to identify which commands should cancel the current command.
The text was updated successfully, but these errors were encountered: