\think\workerWorker

Worker 命令行服务类

Summary

Methods
Properties
Constants
__construct()
__set()
__call()
setAppPath()
setStaticOption()
option()
onWorkerStart()
onMessage()
start()
stop()
No public properties found
No constants found
init()
$worker
$socket
$protocol
$host
$port
$option
$context
$event
$app
$appPath
N/A
No private methods found
No private properties found
N/A

Properties

$worker

$worker : 

Type

$socket

$socket : 

Type

$protocol

$protocol : 

Type

$host

$host : 

Type

$port

$port : 

Type

$option

$option : 

Type

$context

$context : 

Type

$event

$event : 

Type

$app

$app : 

Type

$appPath

$appPath : 

Type

Methods

__construct()

__construct(string  $host, integer  $port, array  $context = array()) 

架构函数

Parameters

string $host

监听地址

integer $port

监听端口

array $context

参数

__set()

__set(  $name,   $value) 

Parameters

$name
$value

__call()

__call(  $method,   $args) 

Parameters

$method
$args

setAppPath()

setAppPath(  $path) 

Parameters

$path

setStaticOption()

setStaticOption(  $name,   $value) 

Parameters

$name
$value

option()

option(array  $option) : void

设置参数

Parameters

array $option

参数

onWorkerStart()

onWorkerStart(\Workerman\Worker  $worker) : void

onWorkerStart 事件回调

Parameters

\Workerman\Worker $worker

onMessage()

onMessage(\Workerman\Connection\TcpConnection  $connection, mixed  $data) : void

onMessage 事件回调

Parameters

\Workerman\Connection\TcpConnection $connection
mixed $data

start()

start() : void

启动

stop()

stop() : void

停止

init()

init()