-
Notifications
You must be signed in to change notification settings - Fork 0
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
1f310b9
commit 28d5f80
Showing
5 changed files
with
73 additions
and
7 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
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 |
---|---|---|
@@ -1,11 +1,26 @@ | ||
from typing import Optional | ||
|
||
from fast_agave.tasks.sqs_tasks import task | ||
|
||
from pydantic import BaseModel | ||
|
||
# Esta URL es solo un mock de la queue. | ||
# Debes reemplazarla con la URL de tu queue | ||
QUEUE_URL = 'http://127.0.0.1:4000/123456789012/core.fifo' | ||
QUEUE2_URL = 'http://127.0.0.1:4000/123456789012/validator.fifo' | ||
|
||
|
||
class ValidatorModel(BaseModel): | ||
name: str | ||
age: int | ||
nick_name: Optional[str] | ||
|
||
|
||
@task(queue_url=QUEUE_URL, region_name='us-east-1') | ||
async def dummy_task(message) -> None: | ||
print(message) | ||
|
||
|
||
@task(queue_url=QUEUE2_URL, region_name='us-east-1', validator=ValidatorModel) | ||
async def task_validator(message: ValidatorModel) -> None: | ||
print(message.dict()) |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.8.0' | ||
__version__ = '0.8.1.dev0' |
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