Documentation

MessageDriverInterface

Minimal driver interface for queue backends.

Table of Contents

Methods

getMessage()  : array<string|int, mixed>|null
Return message envelope by id or null if not found.
isOnline()  : bool
Health check
listKeys()  : iterable<string|int, string>
Return iterable of message IDs (strings).
remove()  : bool
saveMessage()  : string
Save an envelope into the queue.

Methods

getMessage()

Return message envelope by id or null if not found.

public getMessage(string $key) : array<string|int, mixed>|null

Envelope is an associative array with keys:

  • id: string
  • class: string (task class)
  • body: mixed (serialized payload)
  • attempts: int
  • available_at: int (unix ts ms)
  • created_at: int (unix ts ms)
  • meta: array
Parameters
$key : string
Return values
array<string|int, mixed>|null

listKeys()

Return iterable of message IDs (strings).

public listKeys() : iterable<string|int, string>

Implementations may return in-queue order.

Return values
iterable<string|int, string>

saveMessage()

Save an envelope into the queue.

public saveMessage(array<string|int, mixed> $envelope[, string $position = 'append' ]) : string
Parameters
$envelope : array<string|int, mixed>
$position : string = 'append'

'append'|'prepend'

Return values
string

saved id

On this page

Search results