when(function(\Exception $error = null, $result = null) { * if ($error) { * // failed * } else { * // succeeded * } * }); * * Implementations MUST return the current object instance. * * @param callable $func * @return self */ public function when(callable $func); /** * Notify the $func callback when resolution progress events are emitted * * Implementations MUST invoke $func callback with a single update parameter, e.g.: * * watch(function($update) { ... }); * * Implementations MUST return the current object instance. * * @param callable $func * @return self */ public function watch(callable $func); }