+ $future = $api->getFuture();
+ $context = $future->createContext(function() {
+ if ($this->response) {
+ /* we did finish in the meantime */
+ $this->complete();
+ } else {
+ $this->client->dequeue($this->request);
+ ($this->reject)("Cancelled");
+ }
+ });
+ $this->promise = $future->getPromise($context);
+ $this->resolve = API\Future\resolver($future, $context);
+ $this->reject = API\Future\rejecter($future, $context);
+ }
+
+ function __invoke() : Promise {