yxorP Documentation

worker
in package

Table of Contents

DEFAULT_BACKLOG  = 102400
MAX_UDP_PACKAGE_SIZE  = 65535
STATUS_RELOADING  = 8
STATUS_RUNNING  = 2
STATUS_SHUTDOWN  = 4
STATUS_STARTING  = 1
UI_SAFE_LENGTH  = 4
VERSION  = '1.0.0'
$command  : string
$connections  : array<string|int, mixed>
$count  : int
$daemonize  : bool
$eventLoopClass  : string
$globalEvent  : mixed
$group  : string
$id  : int
$logFile  : string
$name  : string
$onBufferDrain  : mixed
$onBufferFull  : mixed
$onClose  : mixed
$onConnect  : mixed
$onError  : mixed
$onMasterReload  : mixed
$onMasterStop  : mixed
$onMessage  : mixed
$onWorkerReload  : mixed
$onWorkerStart  : mixed
$onWorkerStop  : mixed
$pidFile  : string
$processTitle  : string
$protocol  : mixed
$reloadable  : bool
$reusePort  : bool
$statusFile  : string
$stdoutFile  : string
$stopping  : bool
$stopTimeout  : int
$transport  : string
$user  : string
$_availableEventLoops  : array<string|int, mixed>
$_builtinTransports  : array<string|int, mixed>
$_context  : mixed
$_errorType  : array<string|int, mixed>
$_globalStatistics  : array<string|int, mixed>
$_gracefulStop  : bool
$_idMap  : array<string|int, mixed>
$_localSocket  : mixed
$_mainSocket  : mixed
$_masterPid  : int
$_maxProcessesNameLength  : int
$_maxProtoNameLength  : int
$_maxSocketNameLength  : int
$_maxStatusNameLength  : int
$_maxUserNameLength  : int
$_maxWorkerNameLength  : int
$_outputDecorated  : mixed
$_outputStream  : mixed
$_pauseAccept  : bool
$_pidMap  : array<string|int, mixed>
$_pidsToRestart  : array<string|int, mixed>
$_processForWindows  : array<string|int, mixed>
$_socketName  : string
$_startFile  : string
$_statisticsFile  : string
$_status  : int
$_workers  : array<string|int, mixed>
$workerId  : string|null
__construct()  : mixed
acceptTcpConnection()  : mixed
acceptUdpConnection()  : bool
checkErrors()  : mixed
checkIfChildRunning()  : mixed
checkWorkerStatusForWindows()  : mixed
forkOneWorkerForWindows()  : mixed
getAllWorkers()  : array<string|int, mixed>
getArgv()  : array<string|int, mixed>
getEventLoop()  : mixed
getGracefulStop()  : bool
getMainSocket()  : mixed
getSingleLineTotalLength()  : int
getSocketName()  : string
getStartFilesForWindows()  : array<string|int, mixed>
getStatus()  : int
getUiColumns()  : array<string|int, mixed>
listen()  : mixed
log()  : mixed
pauseAccept()  : mixed
reloadAllWorkers()  : mixed
resetStd()  : mixed
resumeAccept()  : mixed
run()  : mixed
runAll()  : mixed
safeEcho()  : bool
setUserAndGroup()  : mixed
signalHandler()  : mixed
stop()  : mixed
stopAll()  : mixed
unlisten()  : mixed
checkMasterIsAlive()  : bool
checkSapiEnv()  : mixed
daemonize()  : mixed
displayUI()  : mixed
exitAndClearAll()  : mixed
forkOneWorkerForLinux()  : mixed
forkWorkers()  : mixed
forkWorkersForLinux()  : mixed
forkWorkersForWindows()  : mixed
formatStatusData()  : string
getAllWorkerPids()  : array<string|int, mixed>
getCurrentUser()  : mixed
getErrorType()  : string|array<string|int, mixed>|object|null
getEventLoopName()  : string
getId()  : bool|int|string
init()  : mixed
initId()  : mixed
initWorkers()  : mixed
installSignal()  : mixed
lock()  : mixed
monitorWorkers()  : mixed
monitorWorkersForLinux()  : mixed
monitorWorkersForWindows()  : mixed
parseCommand()  : mixed
parseSocketAddress()  : mixed
reinstallSignal()  : mixed
reload()  : mixed
saveMasterPid()  : mixed
setProcessTitle()  : mixed
unlock()  : mixed
writeConnectionsStatisticsToStatusFile()  : mixed
writeStatisticsToStatusFile()  : mixed
outputStream()  : bool

Constants

DEFAULT_BACKLOG

public mixed DEFAULT_BACKLOG = 102400

MAX_UDP_PACKAGE_SIZE

public mixed MAX_UDP_PACKAGE_SIZE = 65535

STATUS_RELOADING

public mixed STATUS_RELOADING = 8

STATUS_RUNNING

public mixed STATUS_RUNNING = 2

STATUS_SHUTDOWN

public mixed STATUS_SHUTDOWN = 4

STATUS_STARTING

public mixed STATUS_STARTING = 1

UI_SAFE_LENGTH

public mixed UI_SAFE_LENGTH = 4

VERSION

public mixed VERSION = '1.0.0'

Properties

$command

public static string $command = ''

$connections

public array<string|int, mixed> $connections = []

$daemonize

public static bool $daemonize = false

$eventLoopClass

public static string $eventLoopClass = ''

$globalEvent

public static mixed $globalEvent = null

$group

public string $group = ''

$logFile

public static string $logFile = ''

$name

public string $name = 'none'

$onBufferDrain

public mixed $onBufferDrain = null

$onBufferFull

public mixed $onBufferFull = null

$onClose

public mixed $onClose = null

$onConnect

public mixed $onConnect = null

$onError

public mixed $onError = null

$onMasterReload

public static mixed $onMasterReload = null

$onMasterStop

public static mixed $onMasterStop = null

$onMessage

public mixed $onMessage = null

$onWorkerReload

public mixed $onWorkerReload = null

$onWorkerStart

public mixed $onWorkerStart = null

$onWorkerStop

public mixed $onWorkerStop = null

$pidFile

public static string $pidFile = ''

$processTitle

public static string $processTitle = 'YXORP'

$protocol

public mixed $protocol = null

$reloadable

public bool $reloadable = true

$reusePort

public bool $reusePort = false

$statusFile

public static string $statusFile = ''

$stdoutFile

public static string $stdoutFile = '/dev/null'

$stopping

public bool $stopping = false

$stopTimeout

public static int $stopTimeout = 2

$transport

public string $transport = 'tcp'

$_availableEventLoops

private static array<string|int, mixed> $_availableEventLoops = ["event" => \yxorP\events\event::class]

$_builtinTransports

private static array<string|int, mixed> $_builtinTransports = ['tcp' => 'tcp', 'udp' => 'udp', 'unix' => 'unix', 'ssl' => 'tcp']

$_context

private mixed $_context = null

$_errorType

private static array<string|int, mixed> $_errorType = [E_ERROR => 'E_ERROR', E_WARNING => 'E_WARNING', E_PARSE => 'E_PARSE', E_NOTICE => 'E_NOTICE', E_CORE_ERROR => 'E_CORE_ERROR', E_CORE_WARNING => 'E_CORE_WARNING', E_COMPILE_ERROR => 'E_COMPILE_ERROR', E_COMPILE_WARNING => 'E_COMPILE_WARNING', E_USER_ERROR => 'E_USER_ERROR', E_USER_WARNING => 'E_USER_WARNING', E_USER_NOTICE => 'E_USER_NOTICE', E_STRICT => 'E_STRICT', E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', E_DEPRECATED => 'E_DEPRECATED', E_USER_DEPRECATED => 'E_USER_DEPRECATED']

$_globalStatistics

private static array<string|int, mixed> $_globalStatistics = ['start_timestamp' => 0, 'worker_exit_info' => []]

$_gracefulStop

private static bool $_gracefulStop = false

$_idMap

private static array<string|int, mixed> $_idMap = []

$_localSocket

private mixed $_localSocket = null

$_mainSocket

private mixed $_mainSocket = null

$_masterPid

private static int $_masterPid = 0

$_maxProcessesNameLength

private static int $_maxProcessesNameLength = 9

$_maxProtoNameLength

private static int $_maxProtoNameLength = 4

$_maxSocketNameLength

private static int $_maxSocketNameLength = 12

$_maxStatusNameLength

private static int $_maxStatusNameLength = 1

$_maxUserNameLength

private static int $_maxUserNameLength = 12

$_maxWorkerNameLength

private static int $_maxWorkerNameLength = 12

$_outputDecorated

private static mixed $_outputDecorated = null

$_outputStream

private static mixed $_outputStream = null

$_pauseAccept

private bool $_pauseAccept = true

$_pidMap

private static array<string|int, mixed> $_pidMap = []

$_pidsToRestart

private static array<string|int, mixed> $_pidsToRestart = []

$_processForWindows

private static array<string|int, mixed> $_processForWindows = []

$_socketName

private string $_socketName = ''

$_startFile

private static string $_startFile = ''

$_statisticsFile

private static string $_statisticsFile = ''

$_status

private static int $_status = self::STATUS_STARTING

$_workers

private static array<string|int, mixed> $_workers = []

$workerId

private string|null $workerId = null

Methods

__construct()

public __construct([string $socket_name = null ][, array<string|int, mixed> $context_option = [] ]) : mixed
Parameters
$socket_name : string = null
$context_option : array<string|int, mixed> = []
Return values
mixed

acceptTcpConnection()

public acceptTcpConnection(mixed $socket) : mixed
Parameters
$socket : mixed
Return values
mixed

acceptUdpConnection()

public acceptUdpConnection(mixed $socket) : bool
Parameters
$socket : mixed
Return values
bool

checkErrors()

public static checkErrors() : mixed
Return values
mixed

checkIfChildRunning()

public static checkIfChildRunning() : mixed
Return values
mixed

checkWorkerStatusForWindows()

public static checkWorkerStatusForWindows() : mixed
Return values
mixed

forkOneWorkerForWindows()

public static forkOneWorkerForWindows(mixed $start_file) : mixed
Parameters
$start_file : mixed
Return values
mixed

getAllWorkers()

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

getArgv()

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

getEventLoop()

public static getEventLoop() : mixed
Return values
mixed

getGracefulStop()

public static getGracefulStop() : bool
Return values
bool

getMainSocket()

public getMainSocket() : mixed
Return values
mixed

getSingleLineTotalLength()

public static getSingleLineTotalLength() : int
Return values
int

getSocketName()

public getSocketName() : string
Return values
string

getStartFilesForWindows()

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

getStatus()

public static getStatus() : int
Return values
int

getUiColumns()

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

listen()

public listen() : mixed
Tags
throws
Exception
Return values
mixed

log()

public static log(mixed $msg) : mixed
Parameters
$msg : mixed
Return values
mixed

pauseAccept()

public pauseAccept() : mixed
Return values
mixed

reloadAllWorkers()

public static reloadAllWorkers() : mixed
Return values
mixed

resetStd()

public static resetStd([bool $throw_exception = true ]) : mixed
Parameters
$throw_exception : bool = true
Tags
throws
Exception
Return values
mixed

resumeAccept()

public resumeAccept() : mixed
Return values
mixed

run()

public run() : mixed
Return values
mixed

runAll()

public static runAll() : mixed
Tags
throws
Exception
Return values
mixed

safeEcho()

public static safeEcho(string $msg[, bool $decorated = false ]) : bool
Parameters
$msg : string
$decorated : bool = false
Return values
bool

setUserAndGroup()

public setUserAndGroup() : mixed
Return values
mixed

signalHandler()

public static signalHandler(mixed $signal) : mixed
Parameters
$signal : mixed
Tags
throws
Exception
Return values
mixed

stop()

public stop() : mixed
Return values
mixed

stopAll()

public static stopAll(mixed $code[, mixed $log = '' ]) : mixed
Parameters
$code : mixed
$log : mixed = ''
Return values
mixed

unlisten()

public unlisten() : mixed
Return values
mixed

checkMasterIsAlive()

protected static checkMasterIsAlive(mixed $master_pid) : bool
Parameters
$master_pid : mixed
Return values
bool

checkSapiEnv()

protected static checkSapiEnv() : mixed
Return values
mixed

daemonize()

protected static daemonize() : mixed
Tags
throws
Exception
Return values
mixed

displayUI()

protected static displayUI() : mixed
Return values
mixed

exitAndClearAll()

protected static exitAndClearAll() : mixed
Return values
mixed

forkOneWorkerForLinux()

protected static forkOneWorkerForLinux(self $worker) : mixed
Parameters
$worker : self
Tags
throws
Exception
Return values
mixed

forkWorkers()

protected static forkWorkers() : mixed
Tags
throws
Exception
Return values
mixed

forkWorkersForLinux()

protected static forkWorkersForLinux() : mixed
Tags
throws
Exception
Return values
mixed

forkWorkersForWindows()

protected static forkWorkersForWindows() : mixed
Return values
mixed

formatStatusData()

protected static formatStatusData(mixed $statistics_file) : string
Parameters
$statistics_file : mixed
Return values
string

getAllWorkerPids()

protected static getAllWorkerPids() : array<string|int, mixed>
Return values
array<string|int, mixed>

getCurrentUser()

protected static getCurrentUser() : mixed
Return values
mixed

getErrorType()

protected static getErrorType(mixed $type) : string|array<string|int, mixed>|object|null
Parameters
$type : mixed
Return values
string|array<string|int, mixed>|object|null

getEventLoopName()

protected static getEventLoopName() : string
Return values
string

getId()

protected static getId(mixed $worker_id, mixed $pid) : bool|int|string
Parameters
$worker_id : mixed
$pid : mixed
Return values
bool|int|string

init()

protected static init() : mixed
Return values
mixed

initId()

protected static initId() : mixed
Return values
mixed

initWorkers()

protected static initWorkers() : mixed
Return values
mixed

installSignal()

protected static installSignal() : mixed
Return values
mixed

lock()

protected static lock() : mixed
Return values
mixed

monitorWorkers()

protected static monitorWorkers() : mixed
Return values
mixed

monitorWorkersForLinux()

protected static monitorWorkersForLinux() : mixed
Return values
mixed

monitorWorkersForWindows()

protected static monitorWorkersForWindows() : mixed
Return values
mixed

parseCommand()

protected static parseCommand() : mixed
Return values
mixed

parseSocketAddress()

protected parseSocketAddress() : mixed
Tags
throws
Exception
Return values
mixed

reinstallSignal()

protected static reinstallSignal() : mixed
Return values
mixed

reload()

protected static reload() : mixed
Tags
throws
Exception
Return values
mixed

saveMasterPid()

protected static saveMasterPid() : mixed
Tags
throws
Exception
Return values
mixed

setProcessTitle()

protected static setProcessTitle(string $title) : mixed
Parameters
$title : string
Return values
mixed

unlock()

protected static unlock() : mixed
Return values
mixed

writeConnectionsStatisticsToStatusFile()

protected static writeConnectionsStatisticsToStatusFile() : mixed
Return values
mixed

writeStatisticsToStatusFile()

protected static writeStatisticsToStatusFile() : mixed
Return values
mixed

outputStream()

private static outputStream([mixed $stream = null ]) : bool
Parameters
$stream : mixed = null
Return values
bool

Search results