Skip to content

Commit e624417

Browse files
committed
rename to fastapi-cloud-tasks
1 parent 259302b commit e624417

File tree

12 files changed

+17
-17
lines changed

12 files changed

+17
-17
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Gelery
1+
# FastAPI Cloud Tasks
22

33
GCP's Cloud Tasks + FastAPI = Replacement for celery's async delayed tasks.
44

5-
Gelery + Cloud Run = Autoscaled delayed tasks.
5+
FastAPI Cloud Tasks + Cloud Run = Autoscaled delayed tasks.
66

77
## Concept
88

99
[`Cloud Tasks`](https://cloud.google.com/tasks) allows us to schedule a HTTP request in the future.
1010

1111
[FastAPI](https://fastapi.tiangolo.com/tutorial/body/) makes us define complete schema and params for an HTTP endpoint.
1212

13-
Gelery works by putting the two together:
13+
FastAPI Cloud Tasks works by putting the two together:
1414

1515
- It adds a `.delay` method to existing routes on FastAPI.
1616
- When this method is called, it schedules a request with Cloud Tasks.
@@ -151,7 +151,7 @@ TaskRoute = TaskRouteBuilder(
151151
pre_create_hook=oidc_hook(
152152
token=tasks_v2.OidcToken(
153153
# Service account that you created
154-
service_account_email="gelery@gcp-project-id.iam.gserviceaccount.com",
154+
service_account_email="fastapi-cloud-tasks@gcp-project-id.iam.gserviceaccount.com",
155155
audience=base_url,
156156
),
157157
),

examples/full/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import os
22

3-
from gelery.utils import queue_path
3+
from fastapi_cloud_tasks.utils import queue_path
44
from google.cloud import tasks_v2
55

66
TASK_LISTENER_BASE_URL = os.getenv("TASK_LISTENER_BASE_URL", default="http://example.com")
77
TASK_PROJECT_ID = os.getenv("TASK_PROJECT_ID", default="sample-project")
88
TASK_LOCATION = os.getenv("TASK_LOCATION", default="asia-south1")
99
TASK_QUEUE = os.getenv("TASK_QUEUE", default="test-queue")
1010

11-
TASK_SERVICE_ACCOUNT = os.getenv("TASK_SERVICE_ACCOUNT", default=f"gelery@{TASK_PROJECT_ID}.iam.gserviceaccount.com")
11+
TASK_SERVICE_ACCOUNT = os.getenv("TASK_SERVICE_ACCOUNT", default=f"fastapi-cloud-tasks@{TASK_PROJECT_ID}.iam.gserviceaccount.com")
1212

1313
TASK_QUEUE_PATH = queue_path(
1414
project=TASK_PROJECT_ID,

examples/full/tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from examples.full.settings import TASK_LISTENER_BASE_URL, TASK_OIDC_TOKEN, TASK_QUEUE_PATH
55
from fastapi import FastAPI
66
from fastapi.routing import APIRouter
7-
from gelery.hooks import chained_hook, deadline_hook, oidc_hook
8-
from gelery.taskroute import TaskRouteBuilder
7+
from fastapi_cloud_tasks.hooks import chained_hook, deadline_hook, oidc_hook
8+
from fastapi_cloud_tasks.taskroute import TaskRouteBuilder
99
from google.protobuf import duration_pb2
1010

1111
app = FastAPI()

examples/simple/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
from fastapi import FastAPI
55
from fastapi.routing import APIRouter
6-
from gelery.taskroute import TaskRouteBuilder
7-
from gelery.utils import queue_path
6+
from fastapi_cloud_tasks.taskroute import TaskRouteBuilder
7+
from fastapi_cloud_tasks.utils import queue_path
88
from pydantic import BaseModel
99

1010
TaskRoute = TaskRouteBuilder(
File renamed without changes.
File renamed without changes.

gelery/delayer.py renamed to fastapi_cloud_tasks/delayer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from google.cloud import tasks_v2
1010
from google.protobuf import timestamp_pb2
1111

12-
from gelery.exception import MissingParamError, WrongTypeError
13-
from gelery.hooks import Hook
14-
from gelery.utils import err_val, taskMethod
12+
from fastapi_cloud_tasks.exception import MissingParamError, WrongTypeError
13+
from fastapi_cloud_tasks.hooks import Hook
14+
from fastapi_cloud_tasks.utils import err_val, taskMethod
1515

1616
try:
1717
import ujson as json
File renamed without changes.
File renamed without changes.

gelery/taskroute.py renamed to fastapi_cloud_tasks/taskroute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from fastapi.routing import APIRoute
66
from google.cloud import tasks_v2
77

8-
from gelery.delayer import Delayer
9-
from gelery.hooks import Hook, noop_hook
8+
from fastapi_cloud_tasks.delayer import Delayer
9+
from fastapi_cloud_tasks.hooks import Hook, noop_hook
1010

1111

1212
def TaskRouteBuilder(

0 commit comments

Comments
 (0)