Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SMW\MediaWiki\Deferred\TransactionalCallableUpdate Class Reference
Inheritance diagram for SMW\MediaWiki\Deferred\TransactionalCallableUpdate:
Inheritance graph
[legend]
Collaboration diagram for SMW\MediaWiki\Deferred\TransactionalCallableUpdate:
Collaboration graph
[legend]

Public Member Functions

 __construct (callable $callback=null, Database $connection=null)
 
 waitOnTransactionIdle ()
 
 runAsAutoCommit ()
 
 commitWithTransactionTicket ()
 
 addPreCommitableCallback ( $fname, callable $callback)
 
 addPostCommitableCallback ( $fname, callable $callback)
 
 doUpdate ()
 
 cancelOnRollback ( $trigger)
 
- Public Member Functions inherited from SMW\MediaWiki\Deferred\CallableUpdate
 __construct (callable $callback=null)
 
 isCommandLineMode ( $isCommandLineMode)
 
 asPresend ()
 
 getStage ()
 
 setCallback (callable $callback)
 
 enabledDeferredUpdate ( $enabledDeferredUpdate=true)
 
 isDeferrableUpdate ( $isDeferrableUpdate)
 
 catchExceptionAndRethrow ( $catchExceptionAndRethrow)
 
 markAsPending ( $isPending=false)
 
 setFingerprint ( $fingerprint=null)
 
 getFingerprint ()
 
 setOrigin ( $origin)
 
 getOrigin ()
 
 doUpdate ()
 
 pushUpdate ()
 

Static Public Member Functions

static newUpdate (callable $callback, Database $connection)
 
- Static Public Member Functions inherited from SMW\MediaWiki\Deferred\CallableUpdate
static releasePendingUpdates ()
 

Protected Member Functions

 registerUpdate ( $update)
 
 loggableContext ()
 
 emptyCancelCallback ()
 
- Protected Member Functions inherited from SMW\MediaWiki\Deferred\CallableUpdate
 registerUpdate ( $update)
 
 loggableContext ()
 
 emptyCallback ()
 

Additional Inherited Members

- Public Attributes inherited from SMW\MediaWiki\Deferred\CallableUpdate
const STAGE_PRESEND = 'pre'
 
const STAGE_POSTSEND = 'post'
 
- Protected Attributes inherited from SMW\MediaWiki\Deferred\CallableUpdate
 $callback
 
 $isDeferrableUpdate = true
 
 $isCommandLineMode = false
 

Detailed Description

Extends DeferredCallableUpdate to allow handling of transaction related tasks or isolations to ensure an undisturbed update process before and after MediaWiki::preOutputCommit.

GNU GPL v2+

Since
3.0
Author
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\MediaWiki\Deferred\TransactionalCallableUpdate::__construct ( callable  $callback = null,
Database  $connection = null 
)
Since
3.0
Parameters
callable | null$callback
Database | null$connection

Member Function Documentation

◆ addPostCommitableCallback()

SMW\MediaWiki\Deferred\TransactionalCallableUpdate::addPostCommitableCallback (   $fname,
callable  $callback 
)

Attaches a callback post execution of the source callback and is scheduled to be executed after the source callback.

Since
3.0
Parameters
string$fname
Closure$callback

◆ addPreCommitableCallback()

SMW\MediaWiki\Deferred\TransactionalCallableUpdate::addPreCommitableCallback (   $fname,
callable  $callback 
)

Attaches a callback pre-execution of the source callback and is scheduled to be executed before the source callback.

Since
3.0
Parameters
string$fname
Closure$callback

◆ cancelOnRollback()

SMW\MediaWiki\Deferred\TransactionalCallableUpdate::cancelOnRollback (   $trigger)
Since
3.0

◆ commitWithTransactionTicket()

SMW\MediaWiki\Deferred\TransactionalCallableUpdate::commitWithTransactionTicket ( )

It tries to fetch a transactionTicket to assert whether transaction writes are active or not and if available will process Database::commitAndWaitForReplication during DeferredCallableUpdate::doUpdate to safely post commits to the master.

Note
If the commandLine is active then continue an update without a ticket to avoid any update lag or possible transaction lock.
Since
3.0

◆ doUpdate()

SMW\MediaWiki\Deferred\TransactionalCallableUpdate::doUpdate ( )
See also
DeferrableUpdate::doUpdate
Since
3.0

◆ newUpdate()

static SMW\MediaWiki\Deferred\TransactionalCallableUpdate::newUpdate ( callable  $callback,
Database  $connection 
)
static
Since
3.1
Parameters
callable$callback
Database$instance

◆ runAsAutoCommit()

SMW\MediaWiki\Deferred\TransactionalCallableUpdate::runAsAutoCommit ( )
Since
3.0

◆ waitOnTransactionIdle()

SMW\MediaWiki\Deferred\TransactionalCallableUpdate::waitOnTransactionIdle ( )
Note
MW 1.29+ showed transaction collisions (Exception thrown with an uncommitted database transaction), use 'onTransactionIdle' to isolate the update execution.
Since
2.5

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy