PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

ReadAsync

Reads one or more items from the queue as a single atomic operation.

This method does not automatically delete the returned items from the queue but makes them invisible to other ReadAsync calls for the period of the invisibility timeout. The items must be explicitly removed from the queue with MemoryStoreQueue/RemoveAsync before the invisibility timeout expires. The invisibility timeout defaults to 30 seconds unless a different value was provided in MemoryStoreService/GetQueue.

Parameters

Name Type Default Description
int

Number of items to read. The maximum allowed value of this parameter is 100.

false

Controls the behavior of the method in the case the queue has fewer than count items: if set to false the method returns all available items; if set to true, it returns no items. The default value is false.

-1

The duration, in seconds, for which the method will wait if the required number of items is not immediately available in the queue. This parameter can be set to zero to indicate no wait. If this parameter is not provided or set to -1, the method will wait indefinitely.

Returns

Return Type Summary

A tuple of two elements. The first element is an array of item values read from the queue. The second element is a string identifier that should be passed to MemoryStoreQueue/RemoveAsync to permanently remove these items from the queue.