Skip to content

Commit

Permalink
Support google pubsub as adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
Wh1isper committed Sep 9, 2024
1 parent 64d825f commit c28e2d3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Motivation: Redis provided on the cloud is usually only available within a VPC a
## Supported queue service

- [x] AWS SQS
- [x] Google PubSub

Welcome to contribute more queue service, see [adapter/impl](./redis_canal/adapter/impl/) for more details.

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ classifiers = [
]

[project.optional-dependencies]
all = ["redis_canal[sqs]"]
all = ["redis_canal[sqs, pubsub]"]
sqs = ["boto3"]
pubsub = ["google-cloud-pubsub"]
test = [
"pytest",
"pytest-asyncio",
Expand Down
17 changes: 17 additions & 0 deletions redis_canal/adapter/impl/pubsub.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import asyncio
from functools import cached_property
from typing import Awaitable

from redis_canal.adapter.plugin import Adapter, hookimpl
from redis_canal.log import logger
from redis_canal.models import Message
from redis_canal.tools import run_in_threadpool


class PubSubAdapter(Adapter):
pass


@hookimpl
def register(manager):
manager.register(PubSubAdapter)

0 comments on commit c28e2d3

Please sign in to comment.