Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need an async/non-blocking python sns publish() call #4045

Closed
2 tasks
archws225 opened this issue Mar 6, 2024 · 3 comments
Closed
2 tasks

need an async/non-blocking python sns publish() call #4045

archws225 opened this issue Mar 6, 2024 · 3 comments
Assignees
Labels
feature-request This issue requests a feature. needs-major-version Can only be considered for the next major release

Comments

@archws225
Copy link

Describe the feature

the python implementation of publish() is taking too long (typically 70ms latency first call then plateaus around 20ms). I don't need to wait around for a success/failure response. I want to send and forget.

Use Case

No matter how much concurrency I introduce into my python script (asyncio, threadpooling, etc) the sns.publish() is still taking too long. i want to send and forget.

Proposed Solution

can we get an equivalent of amazonSNSAsync.publishAsync() for python?

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

2.85

Environment details (OS name and version, etc.)

linux

@archws225 archws225 added feature-request This issue requests a feature. needs-triage This issue or PR still needs to be triaged. labels Mar 6, 2024
@tim-finnigan tim-finnigan self-assigned this May 7, 2024
@tim-finnigan tim-finnigan added investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-major-version Can only be considered for the next major release and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels May 7, 2024
@tim-finnigan
Copy link
Contributor

Thanks for the feature request. The request for async functionality is not under consideration until the next major version Boto3. Implementing async functionality would require an entire rewrite of Botocore (which provides the low-level core functionality for Boto3) and that effort is currently being allocated to creating a longer term async solution for Botocore users. I recommend tracking this blog for future announcements: https://aws.amazon.com/blogs/developer/.

@tim-finnigan tim-finnigan closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
Copy link

github-actions bot commented May 7, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@gyund
Copy link

gyund commented Dec 4, 2024

@archws225 as temporary workaround until async is supported, you could create a thread pool to wait on IO tasks with futures (if you care about the response).

https://docs.python.org/3/library/concurrent.futures.html

Since the GIL essentially limits CPU bound tasks and not I/O bound tasks, this should work for performing parallel requests and give your program the freedom to move on more efficiently. Just adding this for anyone that comes across this in the future...no pun intended :)

Also of note, await asyncio.to_thread(blocking_task) is another approach if you're already in an async routine and just want to dispatch a thread without managing it in a context like with ThreadPoolExecutor() as pool:.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue requests a feature. needs-major-version Can only be considered for the next major release
Projects
None yet
Development

No branches or pull requests

3 participants