PHP Conference Japan 2024

Fiber 類別

(PHP 8 >= 8.1.0)

簡介

Fiber 代表完整的、可中斷的函式。Fiber 可以從呼叫堆疊中的任何位置暫停,在 Fiber 內部暫停執行,直到稍後恢復 Fiber。

類別概要

final class Fiber {
/* 方法 */
public __construct(callable $callback)
public start(mixed ...$args): mixed
公開 resume(混合 $value = null): 混合
公開 throw(Throwable $exception): 混合
公開 getReturn(): 混合
公開 isStarted(): 布林
公開 isRunning(): 布林
公開 靜態 suspend(混合 $value = null): 混合
公開 靜態 getCurrent(): ?Fiber
}

另請參閱

Fiber 概述

目錄

新增註釋

使用者貢獻的註釋

此頁面沒有使用者貢獻的註釋。
To Top