Task with images #421
Answered
by
danfimov
arnaud-secondlayer
asked this question in
Q&A
|
I want to do some image processing in a task (I receive the image from a fastapi endpoint). |
Answered by
danfimov
May 10, 2025
Replies: 2 comments
|
More efficent way would be to send array of integers, In [1]: a = b"test"
In [2]: list(a)
Out[2]: [116, 101, 115, 116]
In [3]: bytes(list(a))
Out[3]: b'test' |
0 replies
|
If images are big, it probably worth to load them to S3 after recieving them in API endpoint. After that you can send link for this image to task as a parameter. Otherwise it can be not optimal to store big file in storage you use for tasks. I saw a good solution for that problem in taskiq-aio-sqs, where author uses s3 for large taskiq messages automatically after some threshold. You can find code here. |
0 replies
Answer selected by
s3rius
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If images are big, it probably worth to load them to S3 after recieving them in API endpoint. After that you can send link for this image to task as a parameter. Otherwise it can be not optimal to store big file in storage you use for tasks.
I saw a good solution for that problem in taskiq-aio-sqs, where author uses s3 for large taskiq messages automatically after some threshold. You can find code here.