def _run_transaction(self): apiritif.put_into_thread_store(driver=self.driver, func_mode=False, controller=self.controller) apiritif.set_transaction_handlers({ 'enter': [self._enter_handler], 'exit': [self._exit_handler] }) tran = smart_transaction(self.thread_name) with tran: self.transaction_driver = tran.driver self.transaction_controller = tran.controller raise Exception(self.exception_message) self.message_from_thread_store = apiritif.get_from_thread_store( 'message')
def add_flow_markers(): handlers = get_transaction_handlers() handlers["enter"].append(_send_start_flow_marker) handlers["exit"].append(_send_exit_flow_marker) set_transaction_handlers(handlers)
def add_dummy_handlers(): handlers = get_transaction_handlers() handlers["enter"].append(_enter_handler) handlers["exit"].append(_exit_handler) set_transaction_handlers(handlers)