Skip to content

Commit 3102e6c

Browse files
move async handler note
1 parent 347ba08 commit 3102e6c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ async def welcome_new_issue(event, gh, *args, **kwargs):
141141
142142
In this example, we automatically label issues based on their title and post a welcome comment on newly opened issues. The router ensures each webhook is directed to the appropriate handler based on the event type and action.
143143
144+
> [!NOTE]
145+
> Handlers must be async functions as django-github-app uses gidgethub for webhook event routing which only supports async operations. Sync support is planned to better integrate with Django projects that don't use async.
146+
144147
Each handler receives two arguments:
145148
146149
- `event`: A `gidgethub.sansio.Event` containing the webhook payload
@@ -160,9 +163,6 @@ class YourAppConfig(AppConfig):
160163
from . import events # noqa: F401
161164
```
162165
163-
> [!NOTE]
164-
> Handlers must be async functions as django-github-app uses gidgethub for webhook event routing which only supports async operations. Sync support is planned to better integrate with Django projects that don't use async.
165-
166166
For more information about GitHub webhook events and payloads, see these pages in the GitHub docs:
167167
168168
- [Webhook events and payloads](https://docs.github.com/en/webhooks/webhook-events-and-payloads)

0 commit comments

Comments
 (0)