deleteTopic method

Future<void> deleteTopic({
  1. int retries = 5,
  2. required String topic,
})

Deletes the topic. The topic can either be the simple name of the topic or it may be the fully quantified name in the projects/{project}/topics/{topic} format.

After a topic is deleted, a new topic may be created with the same name; this is an entirely new topic with none of the old configuration or subscriptions. Existing subscriptions to this topic are not deleted, but their topic field is set to _deleted-topic_.

Implementation

Future<void> deleteTopic({
  int retries = 5,
  required String topic,
}) async {
  assert(_initialized);
  _logger.fine('[deleteTopic]: start -- [$topic]');
  try {
    await _execute(
      executor: () => _pubsubApi.projects.topics.delete(topic),
      retries: retries,
    );
  } finally {
    _logger.fine('[deleteTopic]: complete -- [$topic]');
  }
}