This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SampleProcess(Process): | |
### | |
### 1. Subclass subscriber to override what you want | |
### | |
class ANFSubscriber(Subscriber): | |
def ondata(self, data): | |
print "custom handling of ANF data" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ion/core/messaging/messaging.py b/ion/core/messaging/messaging.py | |
index 61a8930..1bca0cd 100644 | |
--- a/ion/core/messaging/messaging.py | |
+++ b/ion/core/messaging/messaging.py | |
@@ -212,15 +212,8 @@ class Consumer(messaging.Consumer): | |
@param config is a dict of amqp options that __init__ extracts. | |
""" | |
connection = ex_space.connection # broker connection | |
- # @TODO: Exchange config dict should not clobber the passed in config dict - | |
- # it means that I cannot create a queue with auto_delete=False if the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
@file inttest_ingest.py | |
@author Dave Foster <dfoster@asascience.com> | |
@test | |
""" | |
import ion.util.ionlog | |
from twisted.internet import defer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ion/util/cache.py b/ion/util/cache.py | |
index cdee405..3555ffd 100644 | |
--- a/ion/util/cache.py | |
+++ b/ion/util/cache.py | |
@@ -125,9 +125,14 @@ class LRUDict(object): | |
def purge(self): | |
while self.total_size > self.limit: | |
if self.first == self.last: | |
+ obj = self.first.me[1] | |
+ if hasattr(obj, 'clear'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
def walk(o, cb): | |
if hasattr(o, '__iter__'): | |
if isinstance(o, dict): | |
return dict(((k, walk(v, cb)) for k,v in o.iteritems())) | |
else: | |
return [walk(x, cb) for x in o] | |
else: | |
return cb(o) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from gevent import spawn, joinall | |
import time | |
import IPython | |
def work(): | |
while True: | |
time.sleep(2) | |
print "Hello" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from daemon import DaemonContext | |
from lockfile import FileLock | |
import time | |
with DaemonContext(pidfile=FileLock('down.pid')): | |
from pyon.public import Container | |
print "hello" | |
time.sleep(15) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import msgpack | |
import os | |
import time | |
import base64 | |
def packit(data_size): | |
data = base64.urlsafe_b64encode(os.urandom(data_size)) | |
st = time.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseChannel2(object): | |
_amq_chan = None | |
def __init__(self, close_callback=None): | |
""" | |
Initializes a BaseChannel instance. | |
@param close_callback The method to invoke when close() is called on this BaseChannel. May be left as None, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Transport layer abstractions | |
TODOS: | |
- port _sync_call from Channel layer for better error flow, add close callback to channel/client | |
""" | |
__author__ = 'Dave Foster <dfoster@asascience.com>' |
OlderNewer