コード例 #1
0
 def add(self, task):
     if not self._followed:
         transaction = self._manager.get()
         transaction.join(self)
         transaction.addBeforeCommitHook(self.beforeCommit)
         self._followed = True
     self._tasks[task.__class__.__name__] = task
コード例 #2
0
 def _follow(self):
     if not self._followed:
         service = queryUtility(interfaces.IMessageService)
         if service is None:
             return
         transaction = self.transaction_manager.get()
         transaction.join(self)
         transaction.addBeforeCommitHook(service.send_pending_messages)
         self._followed = True
コード例 #3
0
 def newTransaction(self, transaction):
     self.state = 'new'
     self.sp = self.conn.begin_nested()
     self.state = 'begun'
     transaction.addBeforeCommitHook(self._registerCommit)
コード例 #4
0
ファイル: conftest.py プロジェクト: kidaa/encoded
 def newTransaction(self, transaction):
     self.state = 'new'
     self.sp = self.connection.begin_nested()
     self.state = 'begun'
     transaction.addBeforeCommitHook(self._registerCommit)