google / cloud-tasks
Google Cloud Tasks Client for PHP
Requires
- php: ^8.0
- google/gax: ^1.34.0
Requires (Dev)
- google/cloud-core: ^1.52.7
- phpunit/phpunit: ^9.0
Suggests
- ext-grpc: Enables use of gRPC, a universal high-performance RPC framework created by Google.
- ext-protobuf: Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.
- dev-main
- v1.15.0
- v1.14.6
- v1.14.5
- v1.14.4
- v1.14.3
- v1.14.2
- v1.14.1
- v1.14.0
- v1.13.2
- v1.13.1
- v1.13.0
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.11
- v1.11.10
- v1.11.9
- v1.11.8
- v1.11.7
- v1.11.6
- v1.11.5
- v1.11.4
- v1.11.3
- v1.11.2
- v1.11.1
- v1.11.0
- v1.10.0
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v0.10.0
- v0.9.0
- v0.8.0
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.0
This package is auto-updated.
Last update: 2024-09-28 04:28:45 UTC
README
Idiomatic PHP client for Google Cloud Tasks.
NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.
Installation
To begin, install the preferred dependency manager for PHP, Composer.
Now install this component:
$ composer require google/cloud-tasks
This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) please see our gRPC installation guide.
Authentication
Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.
Sample
require_once __DIR__ . '/vendor/autoload.php'; use Google\Cloud\Tasks\V2\CloudTasksClient; use Google\Cloud\Tasks\V2\Queue; $client = new CloudTasksClient(); $project = 'example-project'; $location = 'us-central1'; $queue = uniqid('example-queue-'); $queueName = $client::queueName($project, $location, $queue); // Create a queue $locationName = $client::locationName($project, $location); $queue = new Queue([ 'name' => $queueName ]); $queue->setName($queueName); $client->createQueue($locationName, $queue); echo "$queueName created." . PHP_EOL; // List queues echo 'Listing the queues' . PHP_EOL; $resp = $client->listQueues($locationName); foreach ($resp->iterateAllElements() as $q) { echo $q->getName() . PHP_EOL; } // Delete the queue $client->deleteQueue($queueName);
Version
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority.
Removal of pull queue
The past version (V2beta2) supported pull queues, but we removed the pull queue support from V2/V2beta3. For more details, read our documentation about the removal.