Home
last modified time | relevance | path

Searched refs:fiber (Results 26 – 50 of 73) sorted by relevance

123

/ext-fiber/tests/
H A Dsilence-operator-outside-fiber.phpt2 Silence operator does not leak into fiber
4 fiber
8 $fiber = @new Fiber(function (): void {
14 @$fiber->start();
18 @$fiber->resume();
24 Warning: Warning A in %ssilence-operator-outside-fiber.php on line %d
26 Warning: Warning B in %ssilence-operator-outside-fiber.php on line %d
28 Warning: Warning C in %ssilence-operator-outside-fiber.php on line %d
30 Warning: Warning D in %ssilence-operator-outside-fiber.php on line %d
H A Dsuspend-outside-fiber.phpt2 Suspend outside fiber
4 fiber
12 Fatal error: Uncaught FiberError: Cannot suspend outside of a fiber in %ssuspend-outside-fiber.php:…
14 #0 %ssuspend-outside-fiber.php(%d): Fiber::suspend(1)
16 thrown in %ssuspend-outside-fiber.php on line %d
H A Dcatch-then-suspend.phpt2 Catch exception thrown into fiber, then suspend again
4 fiber
8 $fiber = new Fiber(function () {
17 var_dump($fiber->start());
19 var_dump($fiber->throw(new Exception));
21 var_dump($fiber->resume());
H A Dsuspend-in-nested-function.phpt4 fiber
13 $fiber = new Fiber(function (): int {
18 var_dump($fiber->start());
19 var_dump($fiber->resume(2));
20 var_dump($fiber->resume(3));
21 var_dump($fiber->getReturn());
H A Dthrow-from-destruct-with-fiber.phpt2 Test destructor throwing with unfinished fiber
4 fiber
10 $fiber = new Fiber(static function() {
13 $fiber->start();
20 Fatal error: Uncaught Exception in %sthrow-from-destruct-with-fiber.php:%d
22 #0 %sthrow-from-destruct-with-fiber.php(%d): class@anonymous->__destruct()
24 thrown in %sthrow-from-destruct-with-fiber.php on line %d
H A Dunfinished-fiber-with-nested-try-catch.phpt2 Test unfinished fiber with nested try/catch blocks
4 fiber
8 $fiber = new Fiber(function (): void {
12 echo "fiber\n";
35 echo "end of fiber should not be reached\n";
38 $fiber->start();
40 unset($fiber); // Destroy fiber object, executing finally block.
46 fiber
H A Dsuspend-in-force-close-fiber-after-shutdown.phpt2 Suspend in force-closed fiber after shutdown
4 fiber
8 $fiber = new Fiber(function (): void {
16 $fiber->start();
24 Fatal error: Uncaught FiberExit: Fiber destroyed in %ssuspend-in-force-close-fiber-after-shutdown.p…
26 #0 %ssuspend-in-force-close-fiber-after-shutdown.php(%d): Fiber::suspend()
30 Next FiberError: Cannot suspend in a force-closed fiber in %ssuspend-in-force-close-fiber-after-shu…
32 #0 %ssuspend-in-force-close-fiber-after-shutdown.php(%d): Fiber::suspend()
35 thrown in %ssuspend-in-force-close-fiber-after-shutdown.php on line %d
H A Dout-of-memory-in-nested-fiber.phpt2 Out of Memory in a nested fiber
4 fiber
16 $fiber = new Fiber(function (): void {
17 $fiber = new Fiber(function (): void {
24 $fiber->start();
27 $fiber->start();
31 … %d bytes exhausted%s(tried to allocate %d bytes) in %sout-of-memory-in-nested-fiber.php on line %d
H A Dstart-arguments.phpt2 Arguments to fiber callback
4 fiber
8 $fiber = new Fiber(function (int $x): int {
12 $x = $fiber->start(1);
13 $fiber->resume(0);
14 var_dump($fiber->getReturn());
16 $fiber = new Fiber(function (int $x): int {
20 $fiber->start('test');
H A Dfiber-created-in-destruct.phpt4 fiber
11 $fiber = new Fiber(static function (): int {
16 var_dump($fiber->start());
17 var_dump($fiber->resume());
18 var_dump($fiber->getReturn());
H A Dcatch.phpt2 Catch exception thrown into fiber
4 fiber
8 $fiber = new Fiber(function () {
16 $value = $fiber->start();
19 $fiber->throw(new Exception('test'));
H A Dunfinished-fiber-with-throw-in-finally.phpt2 Test unfinished fiber with suspend in finally
4 fiber
8 $fiber = new Fiber(function (): void {
12 echo "fiber\n";
37 $fiber->start();
39 unset($fiber); // Destroy fiber object, executing finally block.
45 fiber
49 Cannot suspend in a force-closed fiber
H A Dsilence-operator-inside-fiber.phpt2 Silence operator does not leak out of fiber
4 fiber
14 $fiber = new Fiber(function (): void {
18 $fiber->start();
22 $fiber->resume();
28 Warning: Warning C in %ssilence-operator-inside-fiber.php on line %d
30 Warning: Warning D in %ssilence-operator-inside-fiber.php on line %d
H A Dget-return-after-throwing.phpt2 Fiber::getReturn() after a fiber throws
4 fiber
8 $fiber = new Fiber(fn() => throw new Exception('test'));
11 $fiber->start();
16 $fiber->getReturn();
22 Fatal error: Uncaught FiberError: Cannot get fiber return value: The fiber threw an exception in %s…
H A Ddouble-start.phpt2 Start on already running fiber
4 fiber
8 $fiber = new Fiber(function (): void {
12 $fiber->start();
14 $fiber->start();
18 Fatal error: Uncaught FiberError: Cannot start a fiber that has already been started in %sdouble-st…
H A Dresume.phpt4 fiber
8 $fiber = new Fiber(function (): void {
13 $value = $fiber->start();
15 $fiber->resume($value + 1);
H A Dthrow.phpt2 Test throwing into fiber
4 fiber
8 $fiber = new Fiber(function (): void {
12 $value = $fiber->start();
15 $fiber->throw(new Exception('test'));
H A Dsuspend-in-force-close-fiber-catching-exception.phpt2 Suspend in force-closed fiber, catching exception thrown from destructor
4 fiber
10 $fiber = new Fiber(function (): void {
18 $fiber->start();
28 Cannot suspend in a force-closed fiber
H A Ddebug-backtrace.phpt2 Print backtrace in fiber
4 fiber
13 $fiber = new Fiber(function (): void {
17 $fiber->start();
H A Dout-of-memory-in-fiber.phpt2 Out of Memory in a fiber
4 fiber
16 $fiber = new Fiber(function (): void {
23 $fiber->start();
27 …size of %d bytes exhausted%s(tried to allocate %d bytes) in %sout-of-memory-in-fiber.php on line %d
/ext-fiber/
H A Dconfig.m41 PHP_ARG_ENABLE([fiber],
2 [whether to enable fiber support],
3 [AS_HELP_STRING([--enable-fiber],
4 [Enable fiber support])], [no])
12 src/fiber.c \
15 AC_MSG_CHECKING(for fiber switching context)
16 fiber="yes"
54 fiber="no"
57 if test "$fiber" = 'yes'; then
64 AC_MSG_ERROR([Unable to determine platform for fiber switching context!])
[all …]
H A Dconfig.w321 ARG_ENABLE('fiber', 'fiber support', 'yes');
4 AC_DEFINE('HAVE_FIBER', 1, 'fiber support enabled');
14 var FIBER_SOURCES = 'src\\php_fiber.c src\\fiber.c src\\fiber_asm.c src\\fiber_stack.c';
15 …EXTENSION('fiber', FIBER_SOURCES, null, '/I. /Iinclude /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /DPHP_…
20 PHP_INSTALL_HEADERS("ext/fiber", "php_fiber.h fiber.h");
H A Dphp_fiber.h33 ZEND_BEGIN_MODULE_GLOBALS(fiber)
46 ZEND_END_MODULE_GLOBALS(fiber)
48 extern ZEND_DECLARE_MODULE_GLOBALS(fiber)
50 #define FIBER_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(fiber, v)
H A DREADME.md17 git clone https://github.com/amphp/ext-fiber
18 cd ext-fiber
39 * Starts execution of the fiber. Returns when the fiber suspends or terminates.
52 * Returns when the fiber suspends or terminates.
65 * Returns when the fiber suspends or terminates.
82 * @return bool True if the fiber is suspended.
97 …* @return mixed Return value of the fiber callback. NULL is returned if the fiber does not have a …
99 * @throws FiberError If the fiber has not terminated or the fiber threw an exception.
109 …* Suspend execution of the fiber. The fiber may be resumed with {@see Fiber::resume()} or {@see Fi…
150 public function __construct(Fiber $fiber) {}
[all …]
/ext-fiber/examples/
H A D001-simple.php3 $fiber = new Fiber(function (): void { variable
8 $value = $fiber->start();
12 $fiber->resume('test');

Completed in 44 milliseconds

123