How to use the riffle.want 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 / example / test-numeric-backend.py View on Github external
        @want(int)
        def sendBigInt(i):
            print("{:d}".format(int(i))) # Expects a str, like "9223372036854775807"
            return i
        self.register("sendBigInt", sendBigInt)
github exis-io / Exis / python / example / tour-sub-backend.py View on Github external
        @want(Student)
        def sendStudent(s):
            print s # Expects a Student, like "John Smith, Age: 18, ID: 1234"
        self.register("sendStudent", sendStudent)
github exis-io / Exis / python / example / tour-sub-backend.py View on Github external
        @want(Student)
        def changeStudentID(s):
            print s.studentID # Expects an int, like 1234
            s.changeID(5678)
            return s
        self.register("changeStudentID", changeStudentID)
github exis-io / Exis / python / example / receiver.py View on Github external
    @want(User)
    def model(self, other):
        print "Received a publish from", other
        other.sayHello()
github exis-io / Exis / python / example / tour-reg-backend.py View on Github external
        @want(Student)
        def sendStudent(s):
            print s # Expects a str, like "John Smith, Age: 18, ID: 1234"
        self.register("sendStudent", sendStudent)
github exis-io / Exis / python / example / reg-backend.py View on Github external
        @want(str)
        def regStrInt(s):
            print(s)  # Expects a str, like "Hello"
            return 42
        self.register("regStrInt", regStrInt)
github exis-io / Exis / python / example / reg-backend.py View on Github external
        @want(str)
        def regStrStr(s):
            print(s)  # Expects a str, like "Hello"
            return "Hello World"
        self.register("regStrStr", regStrStr)
github exis-io / Exis / python / example / tour-reg-backend.py View on Github external
        @want(Student)
        def changeStudentID(s):
            print s.studentID # Expects an int, like 1234
            s.changeID(5678)
            return s
        self.register("changeStudentID", changeStudentID)
github exis-io / Exis / python / example / tour-reg-backend.py View on Github external
        @want(str)
        def iWantStrings(s):
            print(s)  # Expects a str, like "Hi"
            return "Thanks for saying {}".format(s)
        self.register("iWantStrings", iWantStrings)
github exis-io / Exis / python / example / adv-backend.py View on Github external
    @want(bool)
    def loggerDone(self, b):
        print b # Expects a bool, like True
        if b:
            self.logger.leave()
        return True