From 790396a8053db0d289ebcfd90d524d6bb787af4a Mon Sep 17 00:00:00 2001 From: Forrest Collman Date: Tue, 7 May 2024 08:23:50 -0700 Subject: [PATCH] adding to readme --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index ea0d2c0..ef6754a 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,31 @@ services: - SQS_QUEUE=my-aws-queue - SQS_REGION=us-west-1 ``` +### Notes on Google PubSub +TaskQueue will try to connect to pubsub using the credentials it finds at ~/.cloudvolume/secrets/google-secret.json + +You must first make both a topic and a subscription that is subscribed to that topic. + +``` +gcloud pubsub topics create TASKQUEUE_TEST_TOPIC +gcloud pubsub subscriptions create TASKQUEUE_TEST_SUBSCRIPTION --topic TASKQUEUE_TEST_TOPIC +``` + +Then you can specify a taskqueue using this url format + +```python +queue_url = "pubsub://projects/seung-lab/topics/TASKQUEUE_TEST_TOPIC/subscriptions/TASKQUEUE_TEST_SUBSCRIPTION" + +tq = TaskQueue(queue_url) +``` +Note that Google PubSub doesn't have all the same features as Amazon SQS, including statistics reporting, and so some features do not function properly with this backend. + +Also, google pubsub libraries are not installed by default and so if you want to use this backend install with the pubsub option + +``` +pip install task-queue[pubsub] +``` + ### Notes on File Queue