How to use the riffle.cumin.reflect function in Riffle

To help you get started, we’ve selected a few Riffle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github exis-io / Exis / python / pyRiffle / riffle / crust.py View on Github external
def _setHandler(self, endpoint, handler, coreFunction, doesReturn):
        '''
        Register or Subscribe. Invokes targetFunction for the given endpoint and handler.

        :param coreFunction: the intended core function, either Subscribe or Register
        :param doesReturn: True if this handler can return a value (is a registration)
        '''

        d, handlerId = Deferred(), utils.newID()
        self.app.deferreds[d.cb], self.app.deferreds[d.eb] = d, d
        self.app.handlers[handlerId] = handler, doesReturn

        coreFunction(endpoint, d.cb, d.eb, handlerId, cumin.reflect(handler))
        return d