Download the PHP package superbalist/php-pubsub-google-cloud without Composer
On this page you can find all versions of the php package superbalist/php-pubsub-google-cloud. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download superbalist/php-pubsub-google-cloud
More information about superbalist/php-pubsub-google-cloud
Files in superbalist/php-pubsub-google-cloud
Package php-pubsub-google-cloud
Short Description A Google Cloud adapter for the php-pubsub package
License MIT
Informations about the package php-pubsub-google-cloud
php-pubsub-google-cloud
A Google Cloud adapter for the php-pubsub package.
Installation
Usage
gRPC Support
Google Cloud PHP v0.12.0 added support for communication over the gRPC protocol.
gRPC is great for high-performance, low-latency applications, and is highly recommended in cases where performance and latency are concerns.
The library will automatically choose gRPC over REST if all dependencies are installed.
- gRPC PECL extension
- google/proto-client-php composer package
- googleapis/proto-client-php composer package
Background Batch Message Support
Google Cloud v0.33.0 added support for queueing messages and publishing in the background. This is available in version 5+ of this package which requires a min version of google/cloud ^0.33.0.
You can enable background batch messaging by setting $backgroundBatching
to true
when constructing the
GoogleCloudPubSubAdapter
or by calling setBackgroundBatching(true)
on an existing adapter.
If the semaphore and pcntl PHP extensions are
enabled AND the IS_BATCH_DAEMON_RUNNING
ENV var is set to true
, the library will queue messages to be published by
the Batch Daemon.
The Batch Daemon needs to be manually run as a long-lived background process.
For all other cases, messages will be queued in memory and will be published before the script terminates using a vendor registered shutdown handler.
Please Note
This is marked by google/cloud as an experimental feature & may change before release in backwards-incompatible ways.
Examples
The library comes with Dockerfile for running the example scripts.
Run make up
.
You will start at a bash
prompt in the /opt/php-pubsub
directory.
If you need another shell to publish a message to a blocking consumer, you can run docker-compose run php-pubsub-google-cloud /bin/bash
To run the examples:
All versions of php-pubsub-google-cloud with dependencies
superbalist/php-pubsub Version ^2.0
google/cloud-pubsub Version ^1.29.0