Documentation

Sqs extends AbstractAdapter
in package

SQS adapter class

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
3.0.0

Table of Contents

Properties

$client  : SqsClient|null
SQS client
$groupId  : string
Message group ID
$priority  : string
Queue priority
$queueUrl  : string|null
Queue URL
$receiptHandles  : array<string|int, mixed>
In-flight receipt handles, keyed by job ID, populated by reserve() and consumed by delete()/release()/bury()

Methods

__construct()  : mixed
Constructor
bury()  : Sqs
Stop redelivering a job. SQS cannot durably record a dead-letter reason from this client alone — configure a native SQS redrive policy on a separate dead-letter queue for real dead-letter handling.
clear()  : Sqs
Clear pending and reserved jobs
clearDead()  : Sqs
client()  : SqsClient|null
Get SQS client (alias)
count()  : int
Count of pending + reserved jobs
countDead()  : int
create()  : Sqs
Create SQS adapter
delete()  : Sqs
Permanently remove a job
deleteDeadJob()  : Sqs
getClient()  : SqsClient|null
Get SQS client
getDeadJob()  : mixed
getDeadJobs()  : array<string|int, mixed>
getEnd()  : int
Get the count of messages on the queue, both visible (pending) and not visible (reserved/in-flight), per the adapter contract
getGroupId()  : string
Get queue group ID
getPriority()  : string
getQueueUrl()  : string
Get queue URL
hasDeadJobs()  : bool
hasJobs()  : bool
Check if adapter has jobs
isFifo()  : bool
isFilo()  : bool
isLifo()  : bool
isLilo()  : bool
push()  : Sqs
Push job on to queue
release()  : Sqs
Put a job back to pending (delete + re-send; SQS has no in-place requeue)
reserve()  : AbstractJob|null
Atomically claim the next eligible job, via SQS's native visibility timeout
retryDeadJob()  : AdapterInterface
Move a dead-letter job back to pending
setPriority()  : AbstractAdapter

Properties

$client

SQS client

protected SqsClient|null $client = null

$groupId

Message group ID

protected string $groupId = 'pop-queue'

$queueUrl

Queue URL

protected string|null $queueUrl = null

$receiptHandles

In-flight receipt handles, keyed by job ID, populated by reserve() and consumed by delete()/release()/bury()

protected array<string|int, mixed> $receiptHandles = []

Methods

__construct()

Constructor

public __construct(SqsClient $client, string $queueUrl[, string $groupId = 'pop-queue' ]) : mixed
Parameters
$client : SqsClient
$queueUrl : string
$groupId : string = 'pop-queue'

bury()

Stop redelivering a job. SQS cannot durably record a dead-letter reason from this client alone — configure a native SQS redrive policy on a separate dead-letter queue for real dead-letter handling.

public bury(AbstractJob $job[, string|null $reason = null ]) : Sqs
Parameters
$job : AbstractJob
$reason : string|null = null
Return values
Sqs

clear()

Clear pending and reserved jobs

public clear() : Sqs
Return values
Sqs

clearDead()

public clearDead() : Sqs
Return values
Sqs

client()

Get SQS client (alias)

public client() : SqsClient|null
Return values
SqsClient|null

count()

Count of pending + reserved jobs

public count() : int
Return values
int

countDead()

public countDead() : int
Return values
int

create()

Create SQS adapter

public static create(SqsClient $client, string $queueUrl[, string $groupId = 'pop-queue' ]) : Sqs
Parameters
$client : SqsClient
$queueUrl : string
$groupId : string = 'pop-queue'
Return values
Sqs

deleteDeadJob()

public deleteDeadJob(string $jobId) : Sqs
Parameters
$jobId : string
Tags
throws
Exception
Return values
Sqs

getClient()

Get SQS client

public getClient() : SqsClient|null
Return values
SqsClient|null

getDeadJob()

public getDeadJob(string $jobId[, bool $unserialize = true ]) : mixed
Parameters
$jobId : string
$unserialize : bool = true

getDeadJobs()

public getDeadJobs([bool $unserialize = true ]) : array<string|int, mixed>
Parameters
$unserialize : bool = true
Return values
array<string|int, mixed>

getEnd()

Get the count of messages on the queue, both visible (pending) and not visible (reserved/in-flight), per the adapter contract

public getEnd() : int
Return values
int

getGroupId()

Get queue group ID

public getGroupId() : string
Return values
string

getQueueUrl()

Get queue URL

public getQueueUrl() : string
Return values
string

hasDeadJobs()

public hasDeadJobs() : bool
Return values
bool

hasJobs()

Check if adapter has jobs

public hasJobs() : bool
Return values
bool

release()

Put a job back to pending (delete + re-send; SQS has no in-place requeue)

public release(AbstractJob $job[, int|null $delay = null ]) : Sqs
Parameters
$job : AbstractJob
$delay : int|null = null
Return values
Sqs

reserve()

Atomically claim the next eligible job, via SQS's native visibility timeout

public reserve() : AbstractJob|null
Return values
AbstractJob|null

        
On this page

Search results