Page MenuHomeSealhub

MethodCallFuture.php
No OneTemporary

Authored By
Unknown
Size
824 B
Referenced Files
None
Subscribers
None

MethodCallFuture.php

<?php
/**
* Degenerate future which resolves by calling a method.
*
* $future = new MethodCallFuture($calculator, 'add', 1, 2);
*
* This future is similar to @{class:ImmediateFuture}, but may make it easier
* to implement exception behavior correctly. See T13666.
*/
final class MethodCallFuture extends Future {
private $callObject;
private $callMethod;
private $callArgv;
public function __construct($object, $method /* , ...*/ ) {
$argv = func_get_args();
$this->callObject = $object;
$this->callMethod = $method;
$this->callArgv = array_slice($argv, 2);
}
public function isReady() {
$call = array($this->callObject, $this->callMethod);
$argv = $this->callArgv;
$result = call_user_func_array($call, $argv);
$this->setResult($result);
return true;
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Nov 27, 15:07 (7 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1220629
Default Alt Text
MethodCallFuture.php (824 B)

Event Timeline