Comments (2)
I got the same errors, seems strange. Probably, it could depends on event loop model, e.g. it interrupted in the moment when aiohttp makes request, probably not. Would be nice if Matthew Fowler could clarify on this.
from concurrency-in-python-with-asyncio.
Probably I know what's the problem occurs. In the condition
if (self._completed_requests % self._refresh_rate == 0
or self._completed_requests == self._total_requests
):
self._callback(self._completed_requests, self._total_requests)
If refresh rate would be less than 100 it will throw ZeroDivision exception causes troubles. Because default value from listing is set to total_requests // 100
; You can put any value > 0, e.g. +1. Then it starts work as expected. Keep in mind that exceptions in asyncio as described in previous chapters are not really obvious things, you should carefully see possibility to where it could throw.
This solved my problem, but idk if it solves yours. Let me know it you still faces with this issue
from concurrency-in-python-with-asyncio.
Related Issues (15)
- Executing queries concurrently with connection pools (p. 111)
- Creating a REST API with aiohttp (p. 225) HOT 1
- ASGI with Starlette (p. 230)
- RuntimeError: asyncio.run() cannot be called from a running event loop
- Listing 10.8
- Asyncio
- chapter_14 /listing_14_8.py
- chapter_2/listing_2_12.py
- Using process pool executors with asyncio (p. 135)
- tell you a secret{ethereum will go zero }
- Understanding processes, threads, multithreading, and multiprocessing (p. 10) HOT 1
- Introducing coroutines (p. 26) HOT 1
- Asynchronous context managers (p. 78)
- Executing queries concurrently with connection pools (p. 110)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from concurrency-in-python-with-asyncio.