Azure OSS for PHP API Reference

QueueClient
in package

FinalYes

Provides operations for an Azure Storage queue and its messages.

Synchronous methods wait for their corresponding asynchronous operation. Async methods return a Guzzle promise that resolves to the documented result type.

Table of Contents

Properties

$credential  : StorageSharedKeyCredential|TokenCredential|null
$queueName  : string
$uri  : UriInterface
$client  : Client
$options  : QueueClientOptions

Methods

__construct()  : mixed
clearMessages()  : void
Deletes all messages from the queue.
clearMessagesAsync()  : PromiseInterface
Asynchronously deletes all messages from the queue.
create()  : void
Creates the queue.
createAsync()  : PromiseInterface
Asynchronously creates the queue.
createIfNotExists()  : void
Creates the queue if it does not already exist.
createIfNotExistsAsync()  : PromiseInterface
Asynchronously creates the queue if it does not already exist.
delete()  : void
Deletes the queue.
deleteAsync()  : PromiseInterface
Asynchronously deletes the queue.
deleteIfExists()  : void
Deletes the queue if it exists.
deleteIfExistsAsync()  : PromiseInterface
Asynchronously deletes the queue if it exists.
deleteMessage()  : void
Deletes a message using the pop receipt from its most recent receive or update operation.
deleteMessageAsync()  : PromiseInterface
Asynchronously deletes a message using its current pop receipt.
exists()  : bool
Determines whether the queue exists.
existsAsync()  : PromiseInterface
Asynchronously determines whether the queue exists.
getProperties()  : QueueProperties
Gets queue metadata and approximate message count.
getPropertiesAsync()  : PromiseInterface
Asynchronously gets queue metadata and approximate message count.
receiveMessage()  : QueueMessage|null
Receives the next visible message, or null when the queue has no visible messages.
receiveMessageAsync()  : PromiseInterface
Asynchronously receives the next visible message.
receiveMessages()  : array<string|int, QueueMessage>
Receives up to the requested number of visible messages.
receiveMessagesAsync()  : PromiseInterface
Asynchronously receives a batch of visible messages.
sendMessage()  : SendReceipt
Adds a message to the queue.
sendMessageAsync()  : PromiseInterface
Asynchronously adds a message to the queue.
updateMessage()  : UpdateReceipt
Updates a message's content or visibility timeout using its current pop receipt.
updateMessageAsync()  : PromiseInterface
Asynchronously updates a message's content or visibility timeout.
messagesUri()  : UriInterface
messageUri()  : UriInterface

Properties

Methods

__construct()

public __construct(UriInterface $uri[, StorageSharedKeyCredential|TokenCredential|null $credential = null ][, QueueClientOptions $options = new QueueClientOptions() ]) : mixed
Parameters
$uri : UriInterface

URI of the queue, including any SAS query string.

$credential : StorageSharedKeyCredential|TokenCredential|null = null

Credential used to authorize requests, or null for SAS access.

$options : QueueClientOptions = new QueueClientOptions()

Client transport and service-version options.

clearMessages()

Deletes all messages from the queue.

public clearMessages() : void

clearMessagesAsync()

Asynchronously deletes all messages from the queue.

public clearMessagesAsync() : PromiseInterface
Return values
PromiseInterface

createAsync()

Asynchronously creates the queue.

public createAsync() : PromiseInterface
Return values
PromiseInterface

createIfNotExists()

Creates the queue if it does not already exist.

public createIfNotExists() : void

createIfNotExistsAsync()

Asynchronously creates the queue if it does not already exist.

public createIfNotExistsAsync() : PromiseInterface
Return values
PromiseInterface

deleteAsync()

Asynchronously deletes the queue.

public deleteAsync() : PromiseInterface
Return values
PromiseInterface

deleteIfExists()

Deletes the queue if it exists.

public deleteIfExists() : void

deleteIfExistsAsync()

Asynchronously deletes the queue if it exists.

public deleteIfExistsAsync() : PromiseInterface
Return values
PromiseInterface

deleteMessage()

Deletes a message using the pop receipt from its most recent receive or update operation.

public deleteMessage(string $messageId, string $popReceipt) : void
Parameters
$messageId : string
$popReceipt : string

deleteMessageAsync()

Asynchronously deletes a message using its current pop receipt.

public deleteMessageAsync(string $messageId, string $popReceipt) : PromiseInterface
Parameters
$messageId : string
$popReceipt : string
Return values
PromiseInterface

exists()

Determines whether the queue exists.

public exists() : bool
Return values
bool

existsAsync()

Asynchronously determines whether the queue exists.

public existsAsync() : PromiseInterface
Return values
PromiseInterface

getPropertiesAsync()

Asynchronously gets queue metadata and approximate message count.

public getPropertiesAsync() : PromiseInterface
Return values
PromiseInterface

receiveMessage()

Receives the next visible message, or null when the queue has no visible messages.

public receiveMessage([int|null $visibilityTimeout = null ]) : QueueMessage|null
Parameters
$visibilityTimeout : int|null = null
Return values
QueueMessage|null

receiveMessageAsync()

Asynchronously receives the next visible message.

public receiveMessageAsync([int|null $visibilityTimeout = null ]) : PromiseInterface
Parameters
$visibilityTimeout : int|null = null
Return values
PromiseInterface

receiveMessages()

Receives up to the requested number of visible messages.

public receiveMessages([int|null $maxMessages = null ][, int|null $visibilityTimeout = null ]) : array<string|int, QueueMessage>
Parameters
$maxMessages : int|null = null

Maximum messages to receive; Azure Storage accepts 1 through 32.

$visibilityTimeout : int|null = null

Seconds to hide received messages from other consumers.

Return values
array<string|int, QueueMessage>

receiveMessagesAsync()

Asynchronously receives a batch of visible messages.

public receiveMessagesAsync([int|null $maxMessages = null ][, int|null $visibilityTimeout = null ]) : PromiseInterface
Parameters
$maxMessages : int|null = null
$visibilityTimeout : int|null = null
Return values
PromiseInterface

sendMessage()

Adds a message to the queue.

public sendMessage(string $messageText[, int|null $visibilityTimeout = null ][, int|null $timeToLive = null ]) : SendReceipt
Parameters
$messageText : string
$visibilityTimeout : int|null = null

Seconds before the new message becomes visible.

$timeToLive : int|null = null

Message lifetime in seconds; use -1 for no expiry where supported.

Return values
SendReceipt

sendMessageAsync()

Asynchronously adds a message to the queue.

public sendMessageAsync(string $messageText[, int|null $visibilityTimeout = null ][, int|null $timeToLive = null ]) : PromiseInterface
Parameters
$messageText : string
$visibilityTimeout : int|null = null
$timeToLive : int|null = null
Return values
PromiseInterface

updateMessage()

Updates a message's content or visibility timeout using its current pop receipt.

public updateMessage(string $messageId, string $popReceipt, int $visibilityTimeout[, string|null $messageText = null ]) : UpdateReceipt
Parameters
$messageId : string
$popReceipt : string
$visibilityTimeout : int
$messageText : string|null = null
Return values
UpdateReceipt

updateMessageAsync()

Asynchronously updates a message's content or visibility timeout.

public updateMessageAsync(string $messageId, string $popReceipt, int $visibilityTimeout[, string|null $messageText = null ]) : PromiseInterface
Parameters
$messageId : string
$popReceipt : string
$visibilityTimeout : int
$messageText : string|null = null
Return values
PromiseInterface

messagesUri()

private messagesUri() : UriInterface
Return values
UriInterface

messageUri()

private messageUri(string $messageId) : UriInterface
Parameters
$messageId : string
Return values
UriInterface
On this page

Search results