Implement cancellation mechanisms for both gui and beckend.
Implement cancellation mechanisms for both gui and beckend.