Defers the execution of a task.
If the key is the same, the task in the second invocation will override
the previous. In other words, the previous task is canceled.
Force all deferred task (queued by defer) to execute.
If the task given in defer returns an instance of Future, this method
will wait until it completes.