-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d76a1b
commit 5f5f08f
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# [START import] | ||
from typing import List | ||
from nitric.api import Queues, Task | ||
from nitric.api.queues import FailedTask | ||
# [END import] | ||
async def queues_failed(): | ||
# [START snippet] | ||
# Construct a new queue client with default settings | ||
queues = Queues() | ||
|
||
payload = {"content": "of task"} | ||
|
||
# Publish tasks to queue | ||
failed_task = await queues.queue("my-queue").send([Task(payload=payload) for i in range(2)]) | ||
|
||
# Process the failed task | ||
for task in failed_task: | ||
print(task.message) | ||
# [END snippet] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters