Documentation

Factory
in package

工厂化启动器

Table of Contents

Constants

REVOLT_FIBER  = 'Workerman\Events\Revolt'
RIPPLE_FIBER  = \Workbunny\WebmanCoroutine\Factory::RIPPLE_FIBER_4
RIPPLE_FIBER_4  = 'Psc\Drive\Workerman\Driver4'
RIPPLE_FIBER_5  = 'Psc\Drive\Workerman\Driver5'
WORKBUNNY_SWOOLE  = \Workbunny\WebmanCoroutine\Events\SwooleEvent::class
WORKBUNNY_SWOW  = \Workbunny\WebmanCoroutine\Events\SwowEvent::class
WORKERMAN_DEFAULT  = ''
WORKERMAN_SWOOLE  = 'Workerman\Events\Swoole'
WORKERMAN_SWOW  = 'Workerman\Events\Swow'

Methods

get()  : string|null
根据事件循环类获取对应处理器
getAll()  : array<string|int, string>
获取所有事件处理器
getCurrentEventLoop()  : string|null
获取当前事件循环
getCurrentHandler()  : string|null
获取当前使用的处理器类名
init()  : void
初始化
register()  : bool|null
注册事件处理器
unregister()  : bool
注销事件处理器

Constants

REVOLT_FIBER

public mixed REVOLT_FIBER = 'Workerman\Events\Revolt'

RIPPLE_FIBER

public mixed RIPPLE_FIBER = \Workbunny\WebmanCoroutine\Factory::RIPPLE_FIBER_4

RIPPLE_FIBER_4

public mixed RIPPLE_FIBER_4 = 'Psc\Drive\Workerman\Driver4'

RIPPLE_FIBER_5

public mixed RIPPLE_FIBER_5 = 'Psc\Drive\Workerman\Driver5'

WORKBUNNY_SWOOLE

public mixed WORKBUNNY_SWOOLE = \Workbunny\WebmanCoroutine\Events\SwooleEvent::class

WORKBUNNY_SWOW

public mixed WORKBUNNY_SWOW = \Workbunny\WebmanCoroutine\Events\SwowEvent::class

WORKERMAN_DEFAULT

public mixed WORKERMAN_DEFAULT = ''

WORKERMAN_SWOOLE

public mixed WORKERMAN_SWOOLE = 'Workerman\Events\Swoole'

WORKERMAN_SWOW

public mixed WORKERMAN_SWOW = 'Workerman\Events\Swow'

Methods

get()

根据事件循环类获取对应处理器

public static get(null|string $eventLoopClass) : string|null
Parameters
$eventLoopClass : null|string

指定的事件循环类

Return values
string|null

null:未找到

getAll()

获取所有事件处理器

public static getAll() : array<string|int, string>
Return values
array<string|int, string>

getCurrentEventLoop()

获取当前事件循环

public static getCurrentEventLoop() : string|null
Return values
string|null

null:未初始化 空字符串:默认事件

getCurrentHandler()

获取当前使用的处理器类名

public static getCurrentHandler() : string|null
Return values
string|null

null:未初始化

init()

初始化

public static init(string|null $eventLoopClass) : void
Parameters
$eventLoopClass : string|null

register()

注册事件处理器

public static register(string $eventLoopClass, string $handlerClass) : bool|null
Parameters
$eventLoopClass : string

事件循环类名

$handlerClass : string

处理器

Return values
bool|null

null:已经存在 bool:是否注册成功

unregister()

注销事件处理器

public static unregister(string $eventLoopClass) : bool
Parameters
$eventLoopClass : string

事件循环类名

Return values
bool

是否注销成功


        
On this page

Search results