question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add AsyncIO support

See original GitHub issue

Support for asynchronous methods introduced in PEP 0492 and Python 3.5 allow relatively simple asynchronous querying, especially for things like HTTP requests with aiohttp. It would be very useful to be able to use PRAW natively with coroutines.

Here is an example of using aiohttp to query the Reddit API asynchronously.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:8
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
klvbdmhcommented, May 22, 2019

It is relevant if you want to use PRAW with other modules relying on asyncio, like discord.py

0reactions
Dan6erbondcommented, Jul 12, 2019

Seeing this comment chain a little later than I had hoped to find it. @bboe I took a look at your example and comparing it to what I have implemented in my framework it doesn’t seem too far off, yet after letting my bot run for a couple of hours (days, maybe) it will crash due to PRAW blocking the event loop, I think. The error specifically would be:

image

I do have my bot on GitHub so maybe you could give it a quick look? The repository can be found here. It really does seem like I’ll need to give asyncio a shot if using PRAW doesn’t work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

asyncio — Asynchronous I/O — Python 3.11.1 documentation
Hello World!: asyncio is a library to write concurrent code using the async/await syntax. asyncio is used as a foundation for multiple Python...
Read more >
Async IO in Python: A Complete Walkthrough
This tutorial is built to help you answer that question, giving you a firmer grasp of Python's approach to async IO. Here's what...
Read more >
Python Asyncio: The Complete Guide
The asyncio module in Python was added specifically to add support for non-blocking I/O with subprocesses (e.g. executing commands on the ...
Read more >
Asynchronous I/O (asyncio) - SQLAlchemy 1.4 Documentation
Set non-SQL options for the connection which take effect during execution. This returns this AsyncConnection object with the new options added.
Read more >
Python Asyncio Part 5 – Mixing Synchronous and ...
Sadly not all tasks are IO-bound and not all libraries support asyncio. ... instead it creates a future, then adds a callback to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found