intreguei/gcp-pubsub
最新稳定版本:v0.0.2
Composer 安装命令:
composer require intreguei/gcp-pubsub
包简介
Pacote criado para publicação e subscrição de tópicos da gcp
README 文档
README
This library offers a way to use the subscription of GCP pubsub as broadcast using the google/cloud-pubsub library.
A fully-managed real-time messaging service that allows you to send and receive messages between independent applications.
Installation
To begin, install the preferred dependency manager for PHP, Composer.
Now to install just this library:
$ composer require intreguei/gcp-pubsub
Authentication
This library use the Google Cloud PHP authentication. See the Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.
Samples
Publish message on topic:
require 'vendor/autoload.php'; use Intreguei\GcpPubsub\PubSub; $callback = function ($message) { //method to use message from topic } PubSub::listenSubscription('your_topic_name', $callback);
Listen to subscription:
require 'vendor/autoload.php'; use Intreguei\GcpPubsub\PubSub; $dataToPublish = [ 'key_1' => 'data_1', 'key_2' => 'data_2', ]; PubSub::publishMessage('your_topic_name', $dataToPublish); }
References
- Google CLoud official documentation.
- Take a look at Google Cloud in-depth usage samples.
Authors
统计信息
- 总下载量: 1.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-11