Quittio 0.3 API

RenderInvoice
in package
implements ShouldQueue uses InteractsWithQueue, Queueable

FinalYes

Renders an invoice in the queue and stores the main output on a disk.

The invoice travels as JSON snapshot with its version, so jobs queued before an update of the data model are brought up to date by the configured upcasters; the render options travel as versioned JSON as well (RenderOptions::toArray()). Errors that another attempt cannot fix (validation, invalid data, configuration) fail the job at once; others, e.g. a disk that is not reachable, are retried.

Table of Contents

Interfaces

ShouldQueue

Constants

PERMANENT_ERRORS  : array<string|int, mixed> = [\Quittio\Core\Validation\ValidationException::...
Exceptions that fail the job without a further attempt.

Properties

$backoff  : array<int, int>
$disk  : string|null
$invoice  : string
$options  : RenderOptions|string
JSON of RenderOptions::toArray(); a RenderOptions object in jobs queued by Quittio 0.1.0.
$path  : string|null
$tries  : int

Methods

__construct()  : mixed
data()  : InvoiceData
failed()  : void
Called by the queue worker when the job failed for good.
handle()  : void
middleware()  : array<int, object>
renderOptions()  : RenderOptions

Constants

PERMANENT_ERRORS

Exceptions that fail the job without a further attempt.

public array<string|int, mixed> PERMANENT_ERRORS = [\Quittio\Core\Validation\ValidationException::class, \Quittio\Core\Exceptions\InvalidInvoiceData::class, \Quittio\Core\Calculation\CalculationException::class, \Quittio\Core\Exceptions\ConfigurationException::class, \Quittio\Core\Exceptions\HydrationException::class, \Quittio\Core\Serialization\Snapshots\SnapshotVersionException::class, \Quittio\Core\View\MandatoryFieldMissing::class, \Quittio\Core\Exceptions\InvalidArgumentException::class, \JsonException::class]

Properties

$backoff

public array<int, int> $backoff = [10, 60]

seconds before the second and the third attempt

$options

JSON of RenderOptions::toArray(); a RenderOptions object in jobs queued by Quittio 0.1.0.

public RenderOptions|string $options

Methods

__construct()

public __construct(string $invoice, RenderOptions|string $options[, string|null $disk = null ][, string|null $path = null ]) : mixed
Parameters
$invoice : string
$options : RenderOptions|string
$disk : string|null = null
$path : string|null = null

failed()

Called by the queue worker when the job failed for good.

public failed(Throwable $exception) : void
Parameters
$exception : Throwable

middleware()

public middleware() : array<int, object>
Return values
array<int, object>
On this page

Search results