# Path: amfast/class_def/as_types.py
# class AsNoProxy(object):
#     """A no-proxy object.
# 
#     Forces an object to be encoded without a proxy
#     even if use_collection or use_proxies is True.
# 
#     attributes
#     ===========
#     source - object, the no-proxy source.
#     """
# 
#     AS_NO_PROXY = True
# 
#     def __init__(self, source=None):
#         self.source = source


import time
import tornado.web
import amfast
import flex_messages as messaging
import connection_manager as cm
from tornado.ioloop import IOLoop, PeriodicCallback
from amfast.class_def.as_types import AsNoProxy
from channel import ChannelSet, HttpChannel
from endpoint import AmfEndpoint
    def notifyConnection(self, connection_id):
        def _notify():
            self._notifyConnection(connection_id)
        IOLoop.instance().add_callback(_notify)

    def _notifyConnection(self, connection_id):
        try:
            connection = self.connection_manager.getConnection(connection_id, False)
        except cm.NotConnectedError:
            return

        if connection.notify_func is not None:
            IOLoop.instance().add_callback(connection.notify_func)

class CallbackChain(object):
    """Chain together Tornado callbacks.

    When a callback completes, the next in line is called with
    the output of the previous, until the chain is completed."""

    def __init__(self):
        self.callbacks = []

    def addCallback(self, function, args=[], kwargs={}):
        self.callbacks.append({
            'function': function,
            'args': args,
            'kwargs': kwargs
        })


# Path: amfast/class_def/as_types.py
# class AsNoProxy(object):
#     """A no-proxy object.
# 
#     Forces an object to be encoded without a proxy
#     even if use_collection or use_proxies is True.
# 
#     attributes
#     ===========
#     source - object, the no-proxy source.
#     """
# 
#     AS_NO_PROXY = True
# 
#     def __init__(self, source=None):
#         self.source = source


# Path: amfast/remoting/tornado_channel.py
import time
import tornado.web
import amfast
import flex_messages as messaging
import connection_manager as cm
from tornado.ioloop import IOLoop, PeriodicCallback
from amfast.class_def.as_types import AsNoProxy
from channel import ChannelSet, HttpChannel
from endpoint import AmfEndpoint

    def notifyConnection(self, connection_id):
        def _notify():
            self._notifyConnection(connection_id)
        IOLoop.instance().add_callback(_notify)

    def _notifyConnection(self, connection_id):
        try:
            connection = self.connection_manager.getConnection(connection_id, False)
        except cm.NotConnectedError:
            return

        if connection.notify_func is not None:
            IOLoop.instance().add_callback(connection.notify_func)

class CallbackChain(object):
    """Chain together Tornado callbacks.

    When a callback completes, the next in line is called with
    the output of the previous, until the chain is completed."""

    def __init__(self):
        self.callbacks = []

    def addCallback(self, function, args=[], kwargs={}):
        self.callbacks.append({
            'function': function,
            'args': args,
            'kwargs': kwargs
        })


    def execute(self, arg=None):