1
0
mirror of https://github.com/danog/amp.git synced 2025-01-22 13:21:16 +01:00
amp/lib/Promise.php
Aaron Piotrowski 7ebe70e0ae Fix docblock param formatting
Callable prototypes make alignment a mess… maybe something better can be done.
2017-03-10 23:08:40 -06:00

20 lines
588 B
PHP

<?php
namespace Amp;
/**
* Representation of the future value of an asynchronous operation.
*/
interface Promise {
/**
* Registers a callback to be invoked when the promise is resolved.
*
* If the promise is already resolved, the callback MUST be executed immediately.
*
* @param callable(\Throwable|\Exception|null $reason, $value) $onResolved `$reason` shall be `null` on
* success, `$value` shall be `null` on failure.
*
* @return mixed Return type and value are unspecified.
*/
public function when(callable $onResolved);
}