def hop_create(self, classname, arg, replysink, replyname): if classname not in self.classes: namespace.post(replysink, replyname, ['create-failed', ['factory', 'class-not-found']], '') return try: node = self.classes[classname](arg) namespace.post(replysink, replyname, ['create-ok', node.node_info()], '') except Exception, e: import traceback traceback.print_exc() namespace.post(replysink, replyname, ['create-failed', ['constructor', str(e)]], '')
def hop_subscribe(self, filter, sink, name, replysink, replyname): sub = subscription.Subscription(filter, sink, name) self.waiters.put(sub) namespace.post(replysink, replyname, ['subscribe-ok', sub.uuid], '')