public int $state = 'HAZAAR_SERVICE_NONE'
protected Connection $conn
protected Application $application
protected Protocol $protocol
protected array $subscriptions
private array $options = array (
'serviceName' =>
array (
0 => 'n',
1 => 'name',
2 => 'serviceName',
3 => '"\\tStart a service directly from the command line."',
),
'daemon' =>
array (
0 => 'd',
1 => 'daemon',
2 => NULL,
3 => '"\\t\\t\\t\\tStart in daemon mode and wait for a startup packet."',
),
'help' =>
array (
0 => NULL,
1 => 'help',
2 => NULL,
3 => '"\\t\\t\\t\\tPrint this message and exit."',
),
)
public __construct(Application $application, Protocol $protocol, ?string $guid): void
Parameter | Type | Description |
---|
$application | Application | |
$protocol | Protocol | |
$guid | string | |
public __destruct(): void
protected __processCommand(string $command, mixed $payload): bool
Parameter | Type | Description |
---|
$command | string | |
$payload | mixed | |
private __kv_send_recv(string $command, array $data): string
Parameter | Type | Description |
---|
$command | string | |
$data | array | |
Constructor placeholder for child classes.
public construct(Application $application): void
Parameter | Type | Description |
---|
$application | Application | |
Initialisation placeholder for child classes.
public send(string $command, mixed $payload): bool
Parameter | Type | Description |
---|
$command | string | |
$payload | mixed | |
public recv(mixed $payload, int $tv_sec = 3, int $tv_usec = 0): string
Parameter | Type | Description |
---|
$payload | mixed | |
$tv_sec | int | |
$tv_usec | int | |
public ping(bool $waitPong = false): string
Parameter | Type | Description |
---|
$waitPong | bool | |
public subscribe(string $event, string $callback, ?array $filter): bool
Parameter | Type | Description |
---|
$event | string | |
$callback | string | |
$filter | array | |
public unsubscribe(string $event): bool
Parameter | Type | Description |
---|
$event | string | |
public trigger(string $event, mixed $data, bool $echoSelf = false): bool
Parameter | Type | Description |
---|
$event | string | |
$data | mixed | |
$echoSelf | bool | |
public log(int $level, string $message, ?string $name): bool
Parameter | Type | Description |
---|
$level | int | |
$message | string | |
$name | string | |
public debug(mixed $data, ?string $name): bool
Parameter | Type | Description |
---|
$data | mixed | |
$name | string | |
public spawn(string $service, array $params = []): bool
Parameter | Type | Description |
---|
$service | string | |
$params | array | |
public kill(string $service): bool
Parameter | Type | Description |
---|
$service | string | |
public status(): \stdClass
public runDelay(int $delay, callable $callable, array $params = [], ?string $tag, bool $overwrite = false): string
Parameter | Type | Description |
---|
$delay | int | |
$callable | callable | |
$params | array | |
$tag | string | |
$overwrite | bool | |
public interval(int $seconds, string $callable, array $params = [], ?string $tag, bool $overwrite = false): string
Parameter | Type | Description |
---|
$seconds | int | |
$callable | string | |
$params | array | |
$tag | string | |
$overwrite | bool | |
public schedule(DateTime $when, string $callable, array $params = [], ?string $tag, bool $overwrite = false): string
Parameter | Type | Description |
---|
$when | DateTime | |
$callable | string | |
$params | array | |
$tag | string | |
$overwrite | bool | |
public cancel(string $taskID): bool
Parameter | Type | Description |
---|
$taskID | string | |
public startService(string $name): bool
Parameter | Type | Description |
---|
$name | string | |
public stopService(string $name): bool
Parameter | Type | Description |
---|
$name | string | |
public service(string $name): string
Parameter | Type | Description |
---|
$name | string | |
public get(string $key, ?string $namespace): mixed
Parameter | Type | Description |
---|
$key | string | |
$namespace | string | |
public set(string $key, mixed $value, ?int $timeout, ?string $namespace): bool
Parameter | Type | Description |
---|
$key | string | |
$value | mixed | |
$timeout | int | |
$namespace | string | |
public has(string $key, ?string $namespace): string
Parameter | Type | Description |
---|
$key | string | |
$namespace | string | |
public del(string $key, ?string $namespace): string
Parameter | Type | Description |
---|
$key | string | |
$namespace | string | |
public clear(?string $namespace): string
Parameter | Type | Description |
---|
$namespace | string | |
public (?string $namespace): string
Parameter | Type | Description |
---|
$namespace | string | |
public pull(string $key, ?string $namespace): string
Parameter | Type | Description |
---|
$key | string | |
$namespace | string | |
public push(string $key, mixed $value, ?string $namespace): string
Parameter | Type | Description |
---|
$key | string | |
$value | mixed | |
$namespace | string | |
public pop(string $key, ?string $namespace): string
Parameter | Type | Description |
---|
$key | string | |
$namespace | string | |
public shift(string $key, ?string $namespace): string
Parameter | Type | Description |
---|
$key | string | |
$namespace | string | |
public unshift(string $key, mixed $value, ?string $namespace): string
Parameter | Type | Description |
---|
$key | string | |
$value | mixed | |
$namespace | string | |
public incr(string $key, ?int $step, ?string $namespace): string
Parameter | Type | Description |
---|
$key | string | |
$step | int | |
$namespace | string | |
public decr(string $key, ?int $step, ?string $namespace): string
Parameter | Type | Description |
---|
$key | string | |
$step | int | |
$namespace | string | |
public keys(?string $namespace): string
Parameter | Type | Description |
---|
$namespace | string | |
public vals(?string $namespace): string
Parameter | Type | Description |
---|
$namespace | string | |
public count(string $key, ?string $namespace): string
Parameter | Type | Description |
---|
$key | string | |
$namespace | string | |
public runner(Application $application, ?array $argv): int
Parameter | Type | Description |
---|
$application | Application | |
$argv | array | |
public getServiceClass(string $serviceName, Application $application, Protocol $protocol, bool $remote = false): Service
Parameter | Type | Description |
---|
$serviceName | string | |
$application | Application | |
$protocol | Protocol | |
$remote | bool | |
protected setErrorHandler(string $methodName): void
Parameter | Type | Description |
---|
$methodName | string | |
protected setExceptionHandler(string $methodName): void
Parameter | Type | Description |
---|
$methodName | string | |
protected connect(Protocol $protocol, ?string $guid): false
Parameter | Type | Description |
---|
$protocol | Protocol | |
$guid | string | |
protected disconnect(): void
protected connected(): bool
protected makeCallable(\Closure $callable): void
Parameter | Type | Description |
---|
$callable | \Closure | |
private sendExec(string $command, mixed $data, callable $callable, ?array $params, ?string $tag, bool $overwrite = false): string
Parameter | Type | Description |
---|
$command | string | |
$data | mixed | |
$callable | callable | |
$params | array | |
$tag | string | |
$overwrite | bool | |
private getopt(int $): void
Parameter | Type | Description |
---|
$ | int | |
Generated by Hazaar API Doc Generator