Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Michael Corleone says ...

Project Description

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"')

Release History

This version
History Node

0.1.0

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
ciao-0.1.0.tar.gz
(2.7 kB) Copy SHA256 Hash SHA256
Source None Sep 25, 2014

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting