How to use the riffle.utils.newID 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 join(self):
        # TODO: convert the "control plane" to use deferreds using Twisted style callbacks
        cb, eb = utils.newID(2)
        self.app.control[cb] = self.onJoin
        self.mantleDomain.Join(cb, eb)

        self.app.mainGreenlet = greenlet(self.app.handle)
        self.app.mainGreenlet.switch(self.mantleDomain)
github exis-io / Exis / python / pyRiffle / riffle / crust.py View on Github external
def __init__(self):
        self.cb, self.eb = utils.newID(2)
        self.green = None

        # Boy does it hurt me to put this here. canReturn needs to have access to the domain
        # for call returns
        self.mantleDomain = None

        # True if this deferred should inform the core of its types once set
        # Only true for calls
        self.canReturn = False