\Hazaar\Warlock
Server
Summary
Methods Properties Constants
run
$tv
No constants
Properties
$client_lookup
$client_lookup
$clients
$clients
$config
$config
$eventQueue
$eventQueue
Static
$instance
$instance
SERVER INSTANCE
$jobQueue
$jobQueue
$master
$master
SOCKETS & STREAMS
$pcntl_signals
$pcntl_signals
$pid
$pid
$pidfile
$pidfile
$procs
$procs
JOBS & SERVICES
$protocol
$protocol
$rrd
$rrd
$rrdfile
$rrdfile
$running
$running
$services
$services
$shutdown
$shutdown
$silent
$silent
$sockets
$sockets
$start
$start
$stats
$stats
STATISTICS

- processed – Total number of processed jobs & messages - execs – The number of successful job executions - lateExecs – The number of delayed executions - failed – The number of failed job executions - processes – The number of currently running processes - retries – The total number of job retries - queue – Current number of jobs in the queue - limitHits – The number of hits on the process limiter - events – The number of events triggered - waiting – The number of waiting client connections

$tags
$tags
$tv
$tv
$waitQueue
$waitQueue
QUEUES
Methods
__construct()
__construct($silent = false)

Parameters

$silent

No description

__destruct()
__destruct()
addClient()
addClient($id, $socket, $uid = null)

Parameters

$id

No description

$socket

No description

$uid

No description

bootstrap()
bootstrap()
cancelJob()
cancelJob($job_id)

Parameters

$job_id

No description

checkRequestURL()
checkRequestURL($url)

Parameters

$url

No description

commandCancel()
commandCancel($resource, $client, $job_id)

Parameters

$resource

No description

$client

No description

$job_id

No description

commandDelay()
commandDelay($resource, $client, $command)

Parameters

$resource

No description

$client

No description

$command

No description

commandDisable()
commandDisable($resource, $client, $name)

Parameters

$resource

No description

$client

No description

$name

No description

commandEnable()
commandEnable($resource, $client, $name)

Parameters

$resource

No description

$client

No description

$name

No description

commandSchedule()
commandSchedule($resource, $client, $command)

Parameters

$resource

No description

$client

No description

$command

No description

commandService()
commandService($resource, $client, $name)

Parameters

$resource

No description

$client

No description

$name

No description

commandStatus()
commandStatus($resource, $client)

Parameters

$resource

No description

$client

No description

commandStop()
commandStop($resource, $client)

Parameters

$resource

No description

$client

No description

commandSubscribe()
commandSubscribe($resource, $client, $event_id, $filter = null)

Parameters

$resource

No description

$client

No description

$event_id

No description

$filter

No description

commandTrigger()
commandTrigger($resource, $client, $event_id, $data)

Parameters

$resource

No description

$client

No description

$event_id

No description

$data

No description

commandUnsubscribe()
commandUnsubscribe($resource, $client, $event_id)

Parameters

$resource

No description

$client

No description

$event_id

No description

disconnect()
disconnect($socket)

Parameters

$socket

No description

fieldExists()
fieldExists($search, $array)

Parameters

$search

No description

$array

No description

filterEvent()
filterEvent($event, $filter = null) : bool
Tests whether a event should be filtered.

Returns TRUE if the event should be filtered (skipped), and FALSE if the event should be processed.

Parameters

$eventstring

The event to check.

$filterArray

The filter rule to test against.

Returns

\Hazaar\Warlock\bool

Returns TRUE if the event should be filtered (skipped), and FALSE if the event should be processed.

getClient()
getClient($socket)

Parameters

$socket

No description

getFieldValue()
getFieldValue($search, $array)

Parameters

$search

No description

$array

No description

getJobId()
getJobId()
getJobStatus()
getJobStatus($job_id)

Parameters

$job_id

No description

getStatus()
getStatus($full = true)

Parameters

$full

No description

httpResponse()
httpResponse($code, $body = null, $headers = Array ( ) )

Parameters

$code

No description

$body

No description

$headers

No description

initiateHandshake()
initiateHandshake($socket, $request)

Parameters

$socket

No description

$request

No description

isRunning()
isRunning()
ping()
ping($client_id)

Parameters

$client_id

No description

processClient()
processClient($socket)

Parameters

$socket

No description

processCommand()
processCommand($resource, $client, $command, $payload)

Parameters

$resource

No description

$client

No description

$command

No description

$payload

No description

processEventQueue()
processEventQueue($client, $event_id, $filter = null) : boolean

This method is executed when a client connects to see if there are any events waiting in the event queue that the client has not yet seen. If there are, the first event found is sent to the client, marked as seen and then processing stops.

Parameters

$client\Hazaar\Warlock\Client

No description

$event_idstring

No description

$filterArray

No description

Returns

boolean
processFrame()
processFrame($frameBuffer, $client)

Parameters

$frameBuffer

No description

$client

No description

processJobs()
processJobs()
processStreamPacket()
processStreamPacket($id, $proc, $job, $packet)

Parameters

$id

No description

$proc

No description

$job

No description

$packet

No description

processSubscriptionQueue()
processSubscriptionQueue($event_id, $trigger_id = null) : boolean

This method is executed when a event is triggered. It is responsible for sending events to clients that are waiting for the event and marking them as seen by the client.

Parameters

$event_idstring

No description

$trigger_idstring

No description

Returns

boolean
queueCleanup()
queueCleanup()
removeClient()
removeClient($socket) : bool
Removes a client from a socket.

Because a client can have multiple socket connections (in legacy mode) this removes the client reference for that socket. Once there are no more references left the client is completely removed.

Parameters

$socket

No description

Returns

\Hazaar\Warlock\bool
run()
run()
scheduleJob()
scheduleJob($when, $function, $application, $tag = null, $overwrite = false)

Parameters

$when

No description

$function

No description

$application

No description

$tag

No description

$overwrite

No description

send()
send($resource, $command, $payload = null, $is_legacy = true)

Parameters

$resource

No description

$command

No description

$payload

No description

$is_legacy

No description

sendAdminEvent()
sendAdminEvent($command, $data = Array ( ) , $force_queue = false)

Parameters

$command

No description

$data

No description

$force_queue

No description

serviceDisable()
serviceDisable($name)

Parameters

$name

No description

serviceEnable()
serviceEnable($name)

Parameters

$name

No description

setJobStatus()
setJobStatus($job_id, $status)

Parameters

$job_id

No description

$status

No description

shutdown()
shutdown($timeout = 0)

Parameters

$timeout

No description

Static
signalHandler()
signalHandler($signo)

Parameters

$signo

No description

subscribe()
subscribe($resource, $client, $event_id, $filter)

Parameters

$resource

No description

$client

No description

$event_id

No description

$filter

No description

unsubscribe()
unsubscribe($client, $event_id = null, $resource = null)

Parameters

$client

No description

$event_id

No description

$resource

No description