16 private $trxRoundRequirement = self::TRX_ROUND_PRESENT;
24 public function __construct( callable $callback, $fname =
'unknown', $dbws = [] ) {
25 $this->callback = $callback;
26 $this->fname = $fname;
28 $dbws = is_array( $dbws ) ? $dbws : [ $dbws ];
29 foreach ( $dbws as $dbw ) {
30 if ( $dbw && $dbw->trxLevel() ) {
31 $dbw->onTransactionResolution( [ $this,
'cancelOnRollback' ], $fname );
37 if ( $this->callback ) {
38 call_user_func( $this->callback );
47 if ( $trigger === IDatabase::TRIGGER_ROLLBACK ) {
48 $this->callback =
null;
61 $this->trxRoundRequirement = $mode;
65 return $this->trxRoundRequirement;
Deferrable Update for closure/callback.
cancelOnRollback( $trigger)
doUpdate()
Perform the actual work.
setTransactionRoundRequirement( $mode)
getTransactionRoundRequirement()
__construct(callable $callback, $fname='unknown', $dbws=[])
Callback wrapper that has an originating method.
Interface that deferrable updates should implement.
Deferrable update that specifies whether it must run outside of any explicit LBFactory transaction ro...