Page MenuHomePhorge

abstract class Future
libphutil Technical Documentation (Futures)

A 'future' or 'promise' is an object which represents the result of some pending computation. For a more complete overview of futures, see Using Futures.

Methods

public function __get($name)
Inherited

This method is not documented.
Parameters
$name
Return
wild

public function __set($name, $value)
Inherited

This method is not documented.
Parameters
$name
$value
Return
wild

public function current()
Inherited

This method is not documented.
Return
wild

public function key()
Inherited

This method is not documented.
Return
wild

public function next()
Inherited

This method is not documented.
Return
wild

public function rewind()
Inherited

This method is not documented.
Return
wild

public function valid()
Inherited

This method is not documented.
Return
wild

private function throwOnAttemptedIteration()
Inherited

This method is not documented.
Return
wild

public function getPhobjectClassConstant($key, $byte_limit)
Inherited

Phobject

Read the value of a class constant.

This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.

Parameters
string$keyName of the constant.
int|null$byte_limitMaximum number of bytes permitted in the value.
Return
stringValue of the constant.

abstract public function isReady()

Is this future's process complete? Specifically, can this future be resolved without blocking?

Return
boolIf true, the external process is complete and resolving this future will not block.

public function resolve()

Resolve a future and return its result, blocking until the result is ready if necessary.

Return
wildFuture result.

final public function updateFuture()

This method is not documented.
Return
wild

private function startServiceProfiler()

This method is not documented.
Return
wild

private function endServiceProfiler()

This method is not documented.
Return
wild
This method is not documented.
Return
wild
This method is not documented.
Return
wild

public function getReadSockets()

Retrieve a list of sockets which we can wait to become readable while a future is resolving. If your future has sockets which can be select()ed, return them here (or in getWriteSockets()) to make the resolve loop do a select(). If you do not return sockets in either case, you'll get a busy wait.

Return
listA list of sockets which we expect to become readable.

public function getWriteSockets()

Retrieve a list of sockets which we can wait to become writable while a future is resolving. See getReadSockets().

Return
listA list of sockets which we expect to become writable.

public function getDefaultWait()

Default amount of time to wait on stream select for this future. Normally 1 second is fine, but if the future has a timeout sooner than that it should return the amount of time left before the timeout.

Return
wild

public function start()

This method is not documented.
Return
wild

final protected function getResult()

Retrieve the final result of the future.

Return
wildFinal resolution of this future.

final protected function setResult($result)

This method is not documented.
Parameters
$result
Return
wild

final public function hasResult()

This method is not documented.
Return
wild

private function setException($exception)

This method is not documented.
Parameters
$exception
Return
wild

private function getException()

This method is not documented.
Return
wild

final public function hasException()

This method is not documented.
Return
wild

final public function setFutureKey($key)

This method is not documented.
Parameters
$key
Return
wild

final public function getFutureKey()

This method is not documented.
Return
wild

final public function setRaiseExceptionOnStart($raise)

This method is not documented.
Parameters
$raise
Return
wild

final public function getHasFutureStarted()

This method is not documented.
Return
wild

final public function canResolve()

This method is not documented.
Return
wild

private function endFuture()

This method is not documented.
Return
wild