Skip to content

Instantly share code, notes, and snippets.

🙃
wat

Ionel Cristian Mărieș ionelmc

🙃
wat
Block or report user

Report or block ionelmc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:8709531
[2014-01-30 16:19:03,357: INFO/MainProcess] Task __main__.ok[60ce5180-4acd-404c-905d-1c441212a6e3] succeeded in 0.00657280000087s: 'ok'
[DEBUG/MainProcess] Supervisor: cleaning up worker 90
[DEBUG/MainProcess] Supervisor: worked 90 joined
[DEBUG/MainProcess] Supervisor: cleaning up worker 39
[DEBUG/MainProcess] Supervisor: worked 39 joined
[DEBUG/MainProcess] added worker
[INFO/Worker-177466] child process 22679 calling self.run()
[DEBUG/MainProcess] added worker
[2014-01-30 16:19:03,410: ERROR/MainProcess] KeyError(188,) while getting callback in Hub. event=4. fileno=188
[2014-01-30 16:19:03,410: ERROR/MainProcess] KeyError(396,) while getting callback in Hub. event=4. fileno=396
View gist:8730658
[2014-01-31 13:50:36,821: DEBUG/MainProcess] | Worker: Preparing bootsteps.
[2014-01-31 13:50:36,822: DEBUG/MainProcess] | Worker: Building graph...
[2014-01-31 13:50:36,822: DEBUG/MainProcess] | Worker: New boot order: {Timer, Hub, Queues (intra), Pool, Autoscaler, Autoreloader, Beat, StateDB, Consumer}
[2014-01-31 13:50:36,826: DEBUG/MainProcess] | Consumer: Preparing bootsteps.
[2014-01-31 13:50:36,826: DEBUG/MainProcess] | Consumer: Building graph...
[2014-01-31 13:50:36,827: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Events, Heart, Mingle, Tasks, Control, Agent, Gossip, event loop}
[2014-01-31 13:50:36,828: CRITICAL/MainProcess] Getting it on !

-------------- celery@dkbox v3.1.8 (Cipater)
---- **** -----
@ionelmc
ionelmc / supervisor-conf-order.patch
Last active Aug 29, 2015
RPM build scripts for supervisord 3.0 (CentOS/RHEL)
View supervisor-conf-order.patch
--- a/supervisor/options.py
+++ b/supervisor/options.py
@@ -539,11 +539,11 @@
base = os.path.dirname(os.path.abspath(fp.name))
else:
base = '.'
for pattern in files:
pattern = os.path.join(base, pattern)
- for filename in glob.glob(pattern):
+ for filename in sorted(glob.glob(pattern)):
View README.rst

Install dev version of manhole:

pip install https://github.com/ionelmc/python-manhole/archive/master.zip

Poke with USR2, and run (use correct pid):

socat readline unix-connect:/tmp/manhole-12345
View app.py
from logging import getLogger
logger = getLogger(__name__)
import gc
import os
os.environ['MP_LOG'] = '1'
import time
import sys
from tqdm import tqdm
from celery import Celery
View workhorse.py
import errno
import logging
import os
import signal
import sys
import threading
import time
from itertools import count
from logging import getLogger
View mock_task.py
from functools import partial
class MockTask(object):
def __init__(self, func):
self.func = func
def delay(self, *args, **kwargs):
return MockResult(partial(self.func, *args, **kwargs))
class MockTask(object):
def __init__(self, func):
View gist:9749541
from time import sleep
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.web import Application, asynchronous, RequestHandler
from multiprocessing.pool import ThreadPool
_workers = ThreadPool(10)
def run_background(func, callback, args=(), kwds={}):
def _callback(result):
View deep-end-tornado.py
from tornado import ioloop
from tornado import web
from tornado import gen
from tornado.httpclient import AsyncHTTPClient
from functools import wraps
from inspect import isgeneratorfunction
def error_handling(func):
if isgeneratorfunction(func):
@wraps(func)
@ionelmc
ionelmc / pypi-link
Last active Aug 29, 2015
Creates an "alias package".
View pypi-link
You can’t perform that action at this time.