Method DeleteTopicAsync
DeleteTopicAsync(String)
Deletes the specified topic.
Declaration
Task DeleteTopicAsync(string topicName)
Parameters
Type | Name | Description |
---|---|---|
System.String | topicName | Name or pattern to identify topic. |
Returns
Type | Description |
---|---|
Task |
Examples
The following example demonstrates how to delete a topic.
First initialize cache.
Cache cache = NCache.InitializeCache("myCache");
Then get messaging service from cache.
IMessagingService messagingService=cache.MessagingService;
Then delete topic from messagingService
messagingService.DeleteTopicAsync("mytopic").ContinueWith(task =>
{
if (task.Status == TaskStatus.RanToCompletion)
{
Console.WriteLine("Topic Deleted Successfully");
}
if (task.Status == TaskStatus.Faulted)
{
Console.WriteLine("Error has occurred");
}
if (task.Exception != null)
{
Console.WriteLine(task.Exception);
}
});