DynamoBatchRepository
class DynamoBatchRepository implements BatchRepository (View source)
Properties
protected BatchFactory | $factory | The batch factory instance. |
|
protected DynamoDbClient | $dynamoDbClient | The database connection instance. |
|
protected string | $applicationName | The application name. |
|
protected string | $table | The table to use to store batch information. |
|
protected int | $ttl | The time-to-live value for batch records. |
|
protected string | $ttlAttribute | The name of the time-to-live attribute for batch records. |
|
protected Marshaler | $marshaler | The DynamoDB marshaler instance. |
Methods
Create a new batch repository instance.
Increment the total number of jobs within the batch.
Decrement the total number of pending jobs for the batch.
Increment the total number of failed jobs for the batch.
Mark the batch that has the given ID as finished.
Cancel the batch that has the given ID.
Delete the batch that has the given ID.
Rollback the last database transaction for the connection.
Create the underlying DynamoDB table.
Delete the underlying DynamoDB table.
Get the expiry time based on the configured time-to-live.
Get the expression attribute name for the time-to-live attribute.
Serialize the given value.
Unserialize the given value.
Get the underlying DynamoDB client instance.
The name of the table that contains the batch records.
Details
__construct(BatchFactory $factory, DynamoDbClient $dynamoDbClient, string $applicationName, string $table, int|null $ttl, string|null $ttlAttribute)
Create a new batch repository instance.
void
incrementTotalJobs(string $batchId, int $amount)
Increment the total number of jobs within the batch.
UpdatedBatchJobCounts
decrementPendingJobs(string $batchId, string $jobId)
Decrement the total number of pending jobs for the batch.
UpdatedBatchJobCounts
incrementFailedJobs(string $batchId, string $jobId)
Increment the total number of failed jobs for the batch.
mixed
transaction(Closure $callback)
Execute the given Closure within a storage specific transaction.