I am using Azure Storage Queue Client to list all the queues that have been created. There are these two methods client.ListQueuesSegmented
and client.ListQueues
that are in the SDK. Both allow you to query using a prefix. ListQueuesSegmented
uses a token which help you to query the next segment. I am trying to understand in what scenarios you would use one over the other.
ListQueuesSegmented returns the results to you in chunks... to iterate over the list of all queues, you make successive calls to ListQueuesSegmented and pass in the QueueContinuationToken from the prior QueueResultSegment return value (or null if this is the first call to ListQueuesSegmented).
ListQueues will return all the queues to you with one call... but that can be very expensive if you have many queues. Prefer the segmented method unless you know you'll only return a small number of queues.
You should also consider using the async version of these methods, to avoid blocking the calling thread while you wait for results to return.
Best of luck!