FacturaScripts

WorkQueue
in package

La cola de trabajos en segundo plano. Permite añadir workers y lanzar eventos.

Table of Contents

$new_events  : array<string|int, mixed>
$prevent_new_events  : array<string|int, mixed>
$workers_list  : array<string|int, mixed>
addWorker()  : void
clear()  : void
getWorkersList()  : array<string|int, mixed>
matchEvent()  : bool
preventNewEvents()  : void
run()  : bool
send()  : bool
getWorkerClass()  : string
isDuplicated()  : bool
preventDuplicated()  : void
runEvent()  : bool

Properties

$new_events

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

$prevent_new_events

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

$workers_list

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

Methods

addWorker()

public static addWorker(string $worker_name[, string $event = '*' ], int $position) : void
Parameters
$worker_name : string
$event : string = '*'
$position : int
Return values
void

clear()

public static clear() : void
Return values
void

getWorkersList()

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

matchEvent()

public static matchEvent(string $pattern, string $event) : bool
Parameters
$pattern : string
$event : string
Return values
bool

preventNewEvents()

public static preventNewEvents(array<string|int, mixed> $event_names) : void
Parameters
$event_names : array<string|int, mixed>
Return values
void

run()

public static run() : bool
Return values
bool

send()

public static send(string $event, string $value[, array<string|int, mixed> $params = [] ]) : bool
Parameters
$event : string
$value : string
$params : array<string|int, mixed> = []
Return values
bool

getWorkerClass()

private static getWorkerClass(string $worker_name) : string
Parameters
$worker_name : string
Return values
string

Search results