Skip to content

Instantly share code, notes, and snippets.

View binarymachines's full-sized avatar

Dexter Taylor binarymachines

View GitHub Profile

Keybase proof

I hereby claim:

  • I am binarymachines on github.
  • I am binarymachines (https://keybase.io/binarymachines) on keybase.
  • I have a public key ASB6xqeNj3o6QzqIdhDO92N4U8N5OnPika0ZCrZQob85Hwo

To claim this, I am signing this object:

@binarymachines
binarymachines / db_context_mgr.py
Last active August 17, 2018 19:31
Trying to solve the problem of using context managers with transaction pools
from contextlib import contextmanager
from contextlib import ContextDecorator
import psycopg2
from sqlalchemy import create_engine
import os
import uuid
class DBTask(object):
def __init__(self, name='anonymous DB task'):