Simple resource throttling. Get it:
$ pip install coid
use it e.g. like:
import datetime
import ciao
import sqlalchemy as sa
db_engine = sa.create_engine('postgres://mikey:corleone@localhost/study')
db_throttle = ciao.Throttle(
duration=datetime.timedelta(seconds=30),
exc=(
sa.exc.OperationalError,
sa.exc.DisconnectionError,
sa.exc.InvalidRequestError,
sa.exc.InterfaceError,
sa.exc.DatabaseError,
sa.exc.DBAPIError,
),
)
if not db_throttle:
with db_throttle:
db_engine.execute('SELECT * FROM slippers WHERE name = "mine"')
Metadata
Release files for ciao 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ciao-0.1.0.tar.gz | 2.7 kB | Details |
Release files / ciao-0.1.0.tar.gz
| Download URL | ciao-0.1.0.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1001c265c652ab5d5bf53b943d5bce1c42b83b8caf580a2dcd4d577f4648bcbd
|
|
BLAKE2b-256 checksum How to use checksums |
7b37858c0e3513df8445915135a3a59ac1e40d2990a5397bf36bdec5fe9b17de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |