Beispiel #1
0
                    {'seller': 'bookstore'},
                    {'status': 'available'} 
                ]
            }}
        ]
    }
}))
rules.bind_ruleset(6379,  0, "localhost", None, handle)

rules.assert_event(handle, json.dumps({
    'id': 1,
    'sid': 'first',
    'name': 'John Smith',
    'address': '1111 NE 22, Seattle, Wa',
    'phone': '206678787',
    'country': 'US',
    'currency': 'US',
    'seller': 'bookstore',
    'item': 'book',
    'reference': '75323',
    'amount': 500
}))
rules.assert_event(handle, json.dumps({
    'id': 1,
    'sid': 'first',
    'item': 'book',
    'status': 'available',
    'country': 'US',
    'seller': 'bookstore'
}))
result = rules.start_action(handle)
Beispiel #2
0
 def assert_event(self, message):
     return self._handle_result(
         rules.assert_event(self._handle,
                            json.dumps(message, ensure_ascii=False)),
         message)
Beispiel #3
0
 def assert_event(self, message):
     return rules.assert_event(self._handle, json.dumps(message, ensure_ascii=False))
Beispiel #4
0
 def assert_event(self, message):
     return rules.assert_event(self._handle, json.dumps(message))
Beispiel #5
0
 def assert_event(self, message):
     rules.assert_event(self._handle, json.dumps(message))
Beispiel #6
0
 def assert_event(self, message, complete):
     try:
         complete(None, rules.assert_event(self._handle, json.dumps(message)))
     except Exception as error:
         complete(error, None)
Beispiel #7
0
 def assert_event(self, message, complete):
     try:
         complete(None, rules.assert_event(self._handle,
                                           json.dumps(message)))
     except Exception as error:
         complete(error, None)