def store_event(event_name, payload): print "Async: %s" % event_name payload['timestamp'] = datetime.now() try: instance.store_event({'event': event_name, 'payload': payload}) event_stored.send("store_event", command=event_name, payload=payload) except Exception: event_stored_fail.send("store_event", command=event_name, payload=payload) print "EndOf: %s" % event_name
def store_event(self, event_data): self.collection.insert(event_data) event_stored.send(self, event_data=event_data)