定制 luqman-v1/pubsub 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

luqman-v1/pubsub

Composer 安装命令:

composer require luqman-v1/pubsub

包简介

package pubsub google cloud for laravel

README 文档

README

Simple package Laravel 5.2 for using Google Cloud PubSub

Author Total Downloads License

Installation

composer require luqman-v1/pubsub

Register the service provider in app.php

'providers' => [
    // ...
    LuqmanV1\PubSub\PubSubServiceProvider::class,
]

Register the facade in app.php

'aliases' => [
    // ...
    'PubSub' => LuqmanV1\PubSub\Facade::class,
]

First convert the credential.json file to base64 https://www.base64decode.org/

The package has a default configuration which uses the following environment variables.

GCP_CREDENTIALS=SomeAwesomeBase64

Usage

    //for publish message
    $message = [
            'data'       => 'My new message.',
            'attributes' => [
                'location' => 'Detroit',
            ],
        ];
    PubSub::publish("someTopicName", $message);
    
    //for pull message 
     $messages = PubSub::pull("someSubcriberName");
     foreach($messages as $message){
        echo $message->data() . "\n";
        echo $message->attribute('location');
     }
     
     //for another function like create topic or etc 
     call function :  PubSub::pubsub()->methodYouWantUse();
     example :
     PubSub::pubsub()->createTopic('someNewTopicName');

License

MIT

统计信息

  • 总下载量: 4.07k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固