PHP 8.5.0 RC 2 available for testing

The GearmanWorker class

(PECL gearman >= 0.5.0)

Introduction

Class synopsis

class GearmanWorker {
/* Methods */
public __construct ()
public addFunction (
string $function_name,
callable $function,
mixed $context = null ,
int $timeout = 0
): bool
public addOptions (int $option): true
public addServer (string $host = null , int $port = 0, bool $setupExceptionHandler = true ): bool
public addServers (string $servers = null , bool $setupExceptionHandler = true ): bool
public error (): string |false
public getErrno (): int
public options (): int
public register (string $function_name, int $timeout = 0): bool
public removeOptions (int $option): true
public returnCode (): int
public setId (string $id): bool
public setOptions (int $option): true
public setTimeout (int $timeout): true
public timeout (): int
public unregister (string $function_name): bool
public unregisterAll (): bool
public wait (): bool
public work (): bool
}

Table of Contents

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes 1 note

up
1
szhvoj@gmail!com
3 years ago
Use systemd for managing this process:

---- 8< ---- /lib/systemd/system/gearman-worker.service
[Unit]
Description=My own gearman worker

[Service]
ExecStart=/usr/bin/php /var/www/my-worker.php
Restart=always

[Install]
WantedBy=multi-user.target
---- >8 ---- /lib/systemd/system/gearman-worker.service
systemctl daemon-reload
systemctl enable gearman-worker
systemctl start gearman-worker
+add a note

AltStyle によって変換されたページ (->オリジナル) /