Future.onCancel

Future!T onCancel(void delegate() @safe callback) ref @trusted return

Register a callback to be invoked when the future is cancelled.

If the future is already cancelled, the callback is invoked immediately.

Parameters

callbackThe delegate to invoke.

Returns

This future for method chaining.