/** * @throwsThrowable * * This method is used to create a new promise. */publicstaticfunctionc(callable $callback,bool $justGetResult =false):Promise;
/**
* This method is used to get the id of the promise.
*/
publicfunctiongetId():int;
/**
* This method is used to get the fiber of the promise.
*/
publicfunctiongetFiber():Fiber;
/**
* This method is used to check if the promise is just to get the result.
*/
publicfunctionisJustGetResult():bool;
/**
* This method is used to get the time out of the promise.
*/
publicfunctiongetTimeOut():float;
/**
* This method is used to get the time start of the promise.
*/
publicfunctiongetTimeStart():float;
/**
* This method is used to get the time end of the promise.
*/
publicfunctiongetTimeEnd():float;
/**
* This method is used to set the time out of the promise.
*/
publicfunctionsetTimeEnd(float $timeEnd):void;
/**
* This method is used to check if the promise is timed out and can be dropped.
*/
publicfunctioncanDrop():bool;
/**
* This method is used to get the status of the promise.
*/
publicfunctiongetStatus():string;
/**
* This method is used to check if the promise is pending.
*/
publicfunctionisPending():bool;
/**
* This method is used to check if the promise is resolved.
*/
publicfunctionisResolved():bool;
/**
* This method is used to check if the promise is rejected.
*/
publicfunctionisRejected():bool;
/**
* This method is used to get the result of the promise.
*/
publicfunctiongetResult():mixed;
/**
* This method is used to get the return when catch or then of the promise is resolved or rejected.
*/
publicfunctiongetReturn():mixed;
/**
* @throwsThrowable
*
* This method is used to get the callback of the promise.
*/
publicfunctiongetCallback():callable;
/**
* This method is used to resolve the promise.
*/
publicfunctionresolve(mixed $value =''):void;
/**
* This method is used to reject the promise.
*/
publicfunctionreject(mixed $value =''):void;
/**
* This method is used to set the callback when the promise is resolved.
*/
publicfunctionthen(callable $callback):Promise;
/**
* This method is used to set the callback when the promise is rejected.
*/
publicfunctioncatch(callable $callback):Promise;
/**
* This method is used to set the callback when the promise is resolved or rejected.