📜  Lumen 框架承诺 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:48.084000             🧑  作者: Mango

代码示例1
use GuzzleHttp\Promise\Promise;

$promise = new Promise();
$promise->then(
    // $onFulfilled
    function ($value) {
        echo 'The promise was fulfilled.';
    },
    // $onRejected
    function ($reason) {
        echo 'The promise was rejected.';
    }
);