Documentation

Worker
in package

Tags
author

Samuel Roze samuel.roze@gmail.com

author

Tobias Schultze http://tobion.de

final

Table of Contents

Properties

$acks  : array<string|int, mixed>
$bus  : mixed
$eventDispatcher  : mixed
$logger  : mixed
$metadata  : mixed
$receivers  : array<string|int, mixed>
$shouldStop  : bool
$unacks  : SplObjectStorage

Methods

__construct()  : mixed
getMetadata()  : WorkerMetadata
run()  : void
Receive the messages and dispatch them to the bus.
stop()  : void
ack()  : bool
dispatchEvent()  : void
flush()  : bool
handleMessage()  : void

Properties

$acks

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

$eventDispatcher

private mixed $eventDispatcher

$metadata

private mixed $metadata

$receivers

private array<string|int, mixed> $receivers

$shouldStop

private bool $shouldStop = false

$unacks

private SplObjectStorage $unacks

Methods

run()

Receive the messages and dispatch them to the bus.

public run([array<string|int, mixed> $options = [] ]) : void

Valid options are:

  • sleep (default: 1000000): Time in microseconds to sleep after no messages are found
  • queues: The queue names to consume from, instead of consuming from all queues. When this is used, all receivers must implement the QueueReceiverInterface
Parameters
$options : array<string|int, mixed> = []

ack()

private ack() : bool
Return values
bool

dispatchEvent()

private dispatchEvent(object $event) : void
Parameters
$event : object

flush()

private flush(bool $force) : bool
Parameters
$force : bool
Return values
bool

handleMessage()

private handleMessage(Envelope $envelope, string $transportName) : void
Parameters
$envelope : Envelope
$transportName : string

        
On this page

Search results