QueueClient
in package
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
$credential read-only
public
StorageSharedKeyCredential|TokenCredential|null
$credential
= null
$queueName read-only
public
string
$queueName
$uri
public
UriInterface
$uri
$client read-only
private
Client
$client
$options read-only
private
QueueClientOptions
$options
= new QueueClientOptions()
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
PromiseInterfacecreate()
Creates the queue.
public
create() : void
createAsync()
Asynchronously creates the queue.
public
createAsync() : PromiseInterface
Return values
PromiseInterfacecreateIfNotExists()
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
PromiseInterfacedelete()
Deletes the queue.
public
delete() : void
deleteAsync()
Asynchronously deletes the queue.
public
deleteAsync() : PromiseInterface
Return values
PromiseInterfacedeleteIfExists()
Deletes the queue if it exists.
public
deleteIfExists() : void
deleteIfExistsAsync()
Asynchronously deletes the queue if it exists.
public
deleteIfExistsAsync() : PromiseInterface
Return values
PromiseInterfacedeleteMessage()
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
PromiseInterfaceexists()
Determines whether the queue exists.
public
exists() : bool
Return values
boolexistsAsync()
Asynchronously determines whether the queue exists.
public
existsAsync() : PromiseInterface
Return values
PromiseInterfacegetProperties()
Gets queue metadata and approximate message count.
public
getProperties() : QueueProperties
Return values
QueuePropertiesgetPropertiesAsync()
Asynchronously gets queue metadata and approximate message count.
public
getPropertiesAsync() : PromiseInterface
Return values
PromiseInterfacereceiveMessage()
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|nullreceiveMessageAsync()
Asynchronously receives the next visible message.
public
receiveMessageAsync([int|null $visibilityTimeout = null ]) : PromiseInterface
Parameters
- $visibilityTimeout : int|null = null
Return values
PromiseInterfacereceiveMessages()
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
PromiseInterfacesendMessage()
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
SendReceiptsendMessageAsync()
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
PromiseInterfaceupdateMessage()
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
UpdateReceiptupdateMessageAsync()
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
PromiseInterfacemessagesUri()
private
messagesUri() : UriInterface
Return values
UriInterfacemessageUri()
private
messageUri(string $messageId) : UriInterface
Parameters
- $messageId : string