Google\Cloud\PubSub\V1\PublisherClient::deleteTopic PHP Method

deleteTopic() public method

Sample code: try { $publisherClient = new PublisherClient(); $formattedTopic = PublisherClient::formatTopicName("[PROJECT]", "[TOPIC]"); $publisherClient->deleteTopic($formattedTopic); } finally { if (isset($publisherClient)) { $publisherClient->close(); } }
public deleteTopic ( string $topic, array $optionalArgs = [] )
$topic string Name of the topic to delete. Format is `projects/{project}/topics/{topic}`.
$optionalArgs array { Optional. @type \Google\GAX\RetrySettings $retrySettings Retry settings to use for this call. If present, then $timeoutMillis is ignored. @type int $timeoutMillis Timeout to use for this call. Only used if $retrySettings is not set. }
    public function deleteTopic($topic, $optionalArgs = [])
    {
        $request = new DeleteTopicRequest();
        $request->setTopic($topic);
        $mergedSettings = $this->defaultCallSettings['deleteTopic']->merge(new CallSettings($optionalArgs));
        $callable = ApiCallable::createApiCall($this->publisherStub, 'DeleteTopic', $mergedSettings, $this->descriptors['deleteTopic']);
        return $callable($request, [], ['call_credentials_callback' => $this->createCredentialsCallback()]);
    }