CreateTopicAsync() 공개 메소드

Initiates the asynchronous execution of the CreateTopic operation.
public CreateTopicAsync ( CreateTopicRequest request, System cancellationToken = default(CancellationToken) ) : Task
request Amazon.SimpleNotificationService.Model.CreateTopicRequest Container for the necessary parameters to execute the CreateTopic operation.
cancellationToken System /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. ///
리턴 Task
예제 #1
0
 /// <summary>
 /// Ensures the topic. The call to create topic is idempotent and just returns the arn if it already exists. Therefore there is 
 /// no nee to check then create if it does not exist, as this would be extral calls
 /// </summary>
 /// <param name="topicName">Name of the topic.</param>
 /// <param name="client">The client.</param>
 /// <returns>System.String.</returns>
 private string EnsureTopic(string topicName, AmazonSimpleNotificationServiceClient client)
 {
     _logger.Value.DebugFormat("Topic with name {0} does not exist. Creating new topic", topicName);
     var topicResult = client.CreateTopicAsync(new CreateTopicRequest(topicName)).Result;
     return topicResult.HttpStatusCode == HttpStatusCode.OK ? topicResult.TopicArn : string.Empty;
 }