Documentation

Worker extends WorkerInterface

The Interface for worker processes

Tags
deprecated

will be removed in Version 2+

Table of Contents

Methods

onProcessCreate()  : mixed
After the worker has been forked into another process
onProcessDestroy()  : mixed
Before the worker process is getting destroyed
run()  : Serializable
run the work

Methods

onProcessCreate()

After the worker has been forked into another process

public onProcessCreate(Semaphore $semaphore) : mixed
Parameters
$semaphore : Semaphore

the semaphore to run synchronized tasks

Tags
throws
Exception

in case of a processing Error an Exception will be thrown

onProcessDestroy()

Before the worker process is getting destroyed

public onProcessDestroy() : mixed
Tags
throws
Exception

in case of a processing Error an Exception will be thrown

run()

run the work

public run(Serializable $input) : Serializable
Parameters
$input : Serializable

the data, that the worker should process

Tags
throws
Exception

in case of a processing Error an Exception will be thrown

Return values
Serializable

Returns the result


        
On this page

Search results