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
A JavaFX Service can be restarted by calling Service.restart(). If there is a current running task it is cancelled. The behaviour of a DelegateCommand is different. When you execute the DelegateCommand twice it is only started once.
if (inBackground) {
if (!super.isRunning()) {
reset();
start();
}
}
A DelegateCommand is a Service so we can call DelegateCommand.restart() directly. By doing that we don't gain the advantages of the Command class (e.g. testability).
My expectation is:
if (inBackground) {
super.restart();
}
The text was updated successfully, but these errors were encountered:
I understand your argumentation. I would expect the same behavior as you. Still, would like to here something from @lestard or @sialcasa concerning this.
I've created a test case that verifies that both service and delegate command have equal behaviour regarding restarting. It works with your suggested fix.
As far as I can see this should work but I'm not as experienced as alex when it comes to Services and Commands. @sialcasa can you please review this issue and the provided fix?
A JavaFX Service can be restarted by calling
Service.restart()
. If there is a current running task it is cancelled. The behaviour of a DelegateCommand is different. When you execute the DelegateCommand twice it is only started once.A DelegateCommand is a Service so we can call
DelegateCommand.restart()
directly. By doing that we don't gain the advantages of the Command class (e.g. testability).My expectation is:
The text was updated successfully, but these errors were encountered: