1
0
mirror of https://github.com/danog/amp.git synced 2024-12-03 18:07:57 +01:00
amp/stubs/Continuation.php

33 lines
827 B
PHP
Raw Normal View History

2020-11-05 18:29:31 +01:00
<?php
final class Continuation
{
/**
* @return bool True if either {@see resume()} or {@see throw()} has been called previously.
*/
public function continued(): bool { }
/**
* Resumes the fiber, returning the given value from {@see Fiber::suspend()}.
*
* @param mixed $value
*
* @throw FiberError If the continuation has already been used.
*/
public function resume(mixed $value = null): void { }
/**
* Throws the given exception into the fiber from {@see Fiber::suspend()}.
*
* @param Throwable $exception
*
* @throw FiberError If the continuation has already been used.
*/
public function throw(Throwable $exception): void { }
/**
* Cannot be constructed by user code.
*/
private function __construct() { }
}