WebSocketRoute
in package
Read onlyYes
FinalYes
Tags
Table of Contents
Constants
- MODE_CHANNEL = 'channel'
- MODE_HANDLER = 'handler'
Properties
- $channelFactory : Closure|null
- $keyFrom : string|null
- $mode : string
- $path : string
- $targetClass : string
Methods
- __construct() : mixed
- channel() : self
- handler() : self
Constants
MODE_CHANNEL
public
mixed
MODE_CHANNEL
= 'channel'
MODE_HANDLER
public
mixed
MODE_HANDLER
= 'handler'
Properties
$channelFactory
public
Closure|null
$channelFactory
= null
$keyFrom
public
string|null
$keyFrom
$mode
public
string
$mode
$path
public
string
$path
$targetClass
public
string
$targetClass
Methods
__construct()
public
__construct(string $mode, string $path, class-string $targetClass, string|null $keyFrom[, callable(): WebSocketChannelActor|null $channelFactory = null ]) : mixed
Parameters
- $mode : string
- $path : string
- $targetClass : class-string
- $keyFrom : string|null
- $channelFactory : callable(): WebSocketChannelActor|null = null
-
Optional custom factory for channel actors that need constructor-injected dependencies. When null, the dispatcher calls
new $actorClass()(zero-arg construction).
channel()
public
static channel(string $path, class-string $actorClass, string $keyFrom[, callable(): WebSocketChannelActor|null $factory = null ]) : self
Parameters
- $path : string
- $actorClass : class-string
- $keyFrom : string
- $factory : callable(): WebSocketChannelActor|null = null
Return values
selfhandler()
public
static handler(string $path, class-string $handlerClass) : self
Parameters
- $path : string
- $handlerClass : class-string