Skip to content

Commit

Permalink
move async handler note
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas committed Nov 14, 2024
1 parent 347ba08 commit 3102e6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ async def welcome_new_issue(event, gh, *args, **kwargs):
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.
> [!NOTE]
> 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.
Each handler receives two arguments:
- `event`: A `gidgethub.sansio.Event` containing the webhook payload
Expand All @@ -160,9 +163,6 @@ class YourAppConfig(AppConfig):
from . import events # noqa: F401
```
> [!NOTE]
> 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.
For more information about GitHub webhook events and payloads, see these pages in the GitHub docs:
- [Webhook events and payloads](https://docs.github.com/en/webhooks/webhook-events-and-payloads)
Expand Down

0 comments on commit 3102e6c

Please sign in to comment.