Changeset View
Changeset View
Standalone View
Standalone View
src/future/ImmediateFuture.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Degenerate future which returns an already-existing result without performing | * Degenerate future which returns an already-existing result without performing | ||||
| * any computation. | * any computation. | ||||
| */ | */ | ||||
| final class ImmediateFuture extends Future { | final class ImmediateFuture extends Future { | ||||
| public function __construct($result) { | public function __construct($result) { | ||||
| $this->result = $result; | $this->setResult($result); | ||||
| } | } | ||||
| public function isReady() { | public function isReady() { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||