Click or drag to resize
CloudQueuesProviderCreateQueueAsync Method
This API is preliminary and subject to change.
Creates a queue, if it does not already exist.

Namespace: net.openstack.Providers.Rackspace
Assembly: openstacknet (in openstacknet.dll) Version: 1.7.7+Branch.master.Sha.25d803f397c8693c2c13777ef6675f796f520f2c
Syntax
public Task<bool> CreateQueueAsync(
	QueueName queueName,
	CancellationToken cancellationToken
)

Parameters

queueName
Type: net.openstack.Core.Domain.QueuesQueueName
The queue name.
cancellationToken
Type: System.ThreadingCancellationToken
The CancellationToken that the task will observe.

Return Value

Type: TaskBoolean
A Task object representing the asynchronous operation. When the task completes successfully, the Result property will contain if the queue was created by the call, or if the queue already existed.

Implements

IQueueingServiceCreateQueueAsync(QueueName, CancellationToken)
Exceptions
ExceptionCondition
ArgumentNullExceptionIf queueName is .
WebExceptionIf the REST request does not return successfully.
Examples

The following example demonstrates the use of this method using the CloudQueuesProvider implementation of the IQueueingService. For more information about creating the provider, see CloudQueuesProvider(CloudIdentity, String, Guid, Boolean, IIdentityProvider).

Note Note

The following code uses the / operators. For more information about using these operators in your code, see Asynchronous Services.

IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
QueueName queueName = new QueueName("ExampleQueue");
bool createdQueue = await queueingService.CreateQueueAsync(queueName, CancellationToken.None);

The following code shows demonstrates the same example using the Task Parallel Library instead of the / operators.

IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
QueueName queueName = new QueueName("ExampleQueue");
Task<bool> task = queueingService.CreateQueueAsync(queueName, CancellationToken.None);
Version Information

.NET Framework

Supported in: 4.5

openstack.net

Supported in: 1.6, 1.5, 1.4, 1.3.6
See Also