Documentation

PubSub
in package

[$pubsub = $this->core->loadClass('PubSub');] Class to handle Pub/Sub of GCP

https://cloud.google.com/pubsub/docs/quickstart-client-libraries It requires to execute for testing: gcloud pubsub topics create cloudframework-pubsub-test --project={your-project} gcloud pubsub subscriptions create cloudframework-pubsub-test-sub --topic cloudframework-pubsub-test --project={your-project} https://console.cloud.google.com/cloudpubsub/topic/list?folder=&organizationId=&project={your-project} It requires: Pub/Sub Admin

Table of Contents

Properties

$client  : mixed
$error  : mixed
$errorMsg  : mixed
$lastMessages  : mixed
$lastSubscription  : Subscription
$subscription  : mixed
$topic  : mixed
$topicName  : mixed
$core  : mixed

Methods

__construct()  : mixed
DataSQL constructor.
acknowledgeLastMessages()  : Topic|null
getSubscription()  : array<string|int, mixed>|void
Return the $subscription subscriptions for the Application
getSubscriptions()  : array<string|int, mixed>|void
Return the current subscriptions for the Application
getTopics()  : array<string|int, mixed>|void
Return the current subscriptions for the Application
pullMessages()  : Topic|null
pushMessage()  : array<string|int, mixed>|void
Publish a message in a TopicName
subscribeTo()  : Subscription|null
Create a subscripion https://cloud.google.com/pubsub/docs/samples/pubsub-create-pull-subscription
unsubscribeTo()  : Subscription|null
DELETE a subscripion https://cloud.google.com/pubsub/docs/samples/pubsub-delete-subscription
addError()  : mixed
Add Error message

Properties

$client

public mixed $client = \null

PubSubClient|null

$error

public mixed $error = \false

$errorMsg

public mixed $errorMsg = \null

$lastMessages

public mixed $lastMessages = \null

\Google\Cloud\PubSub\Subscription|null

$lastSubscription

public Subscription $lastSubscription = \null

$subscription

public mixed $subscription = \null

$topic

public mixed $topic = \null

\Google\Cloud\PubSub\Topic|null

$topicName

public mixed $topicName = ''

$core

private mixed $core = \null

Methods

__construct()

DataSQL constructor.

public __construct(Core &$core[, mixed $options = [] ]) : mixed
Parameters
$core : Core
$options : mixed = []

acknowledgeLastMessages()

public acknowledgeLastMessages([ $id = null ]) : Topic|null
Parameters
$id : = null

null optional param to acknowledge a specific message

Return values
Topic|null

getSubscription()

Return the $subscription subscriptions for the Application

public getSubscription(mixed $subscription[, mixed $topic = null ]) : array<string|int, mixed>|void
Parameters
$subscription : mixed
$topic : mixed = null
Tags
params

$subscription string subscription to be returned

params

$topic string optionally $topic

Return values
array<string|int, mixed>|void

getSubscriptions()

Return the current subscriptions for the Application

public getSubscriptions() : array<string|int, mixed>|void
Return values
array<string|int, mixed>|void

getTopics()

Return the current subscriptions for the Application

public getTopics() : array<string|int, mixed>|void
Return values
array<string|int, mixed>|void

pullMessages()

public pullMessages(mixed $subscriptionName[, mixed $topicName = null ][, mixed $acknowledge = false ]) : Topic|null
Parameters
$subscriptionName : mixed
$topicName : mixed = null
$acknowledge : mixed = false
Return values
Topic|null

pushMessage()

Publish a message in a TopicName

public pushMessage( $message[, array<string|int, mixed> $attributes = [] ][, null $topicName = null ]) : array<string|int, mixed>|void
Parameters
$message :
$attributes : array<string|int, mixed> = []
$topicName : null = null
Return values
array<string|int, mixed>|void

subscribeTo()

Create a subscripion https://cloud.google.com/pubsub/docs/samples/pubsub-create-pull-subscription

public subscribeTo(mixed $subscriptionName, mixed $topicName) : Subscription|null
Parameters
$subscriptionName : mixed
$topicName : mixed
Return values
Subscription|null

unsubscribeTo()

DELETE a subscripion https://cloud.google.com/pubsub/docs/samples/pubsub-delete-subscription

public unsubscribeTo(mixed $subscriptionName, mixed $topicName) : Subscription|null
Parameters
$subscriptionName : mixed
$topicName : mixed
Return values
Subscription|null

addError()

Add Error message

private addError( $err) : mixed
Parameters
$err :

        
On this page

Search results