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

Public Member Functions

 __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 releasePendingUpdates ()
 

Public Attributes

const STAGE_PRESEND = 'pre'
 
const STAGE_POSTSEND = 'post'
 

Protected Member Functions

 registerUpdate ( $update)
 
 loggableContext ()
 
 emptyCallback ()
 

Protected Attributes

 $callback
 
 $isDeferrableUpdate = true
 
 $isCommandLineMode = false
 

Detailed Description

See also
MWCallableUpdate

GNU GPL v2+

Since
2.4

Constructor & Destructor Documentation

◆ __construct()

SMW\MediaWiki\Deferred\CallableUpdate::__construct ( callable  $callback = null)
Since
2.4
Parameters
callable | null$callback

Member Function Documentation

◆ asPresend()

SMW\MediaWiki\Deferred\CallableUpdate::asPresend ( )
Since
3.0

◆ catchExceptionAndRethrow()

SMW\MediaWiki\Deferred\CallableUpdate::catchExceptionAndRethrow (   $catchExceptionAndRethrow)
Note
MW 1.34+ showed a behaviour where exceptions during a deferred update weren't logged and reported hereby allowing errors to go unnoticed forcing a possible rollback without a chance to investigate missing data updates.
Since
3.1
Parameters
boolean$catchExceptionAndRethrow

◆ doUpdate()

SMW\MediaWiki\Deferred\CallableUpdate::doUpdate ( )
See also
DeferrableUpdate::doUpdate
Since
2.4

◆ enabledDeferredUpdate()

SMW\MediaWiki\Deferred\CallableUpdate::enabledDeferredUpdate (   $enabledDeferredUpdate = true)
Deprecated:
since 3.0, use DeferredCallableUpdate::isDeferrableUpdate
Since
2.4

◆ getFingerprint()

SMW\MediaWiki\Deferred\CallableUpdate::getFingerprint ( )
Since
3.0
Parameters
string | null$queue

◆ getOrigin()

SMW\MediaWiki\Deferred\CallableUpdate::getOrigin ( )
See also
DeferrableCallback::getOrigin
Since
2.5
Returns
string

◆ getStage()

SMW\MediaWiki\Deferred\CallableUpdate::getStage ( )
Since
3.0
Returns
string

◆ isCommandLineMode()

SMW\MediaWiki\Deferred\CallableUpdate::isCommandLineMode (   $isCommandLineMode)
See also
https://www.mediawiki.org/wiki/Manual:$wgCommandLineMode Indicates whether MW is running in command-line mode.
Since
2.5
Parameters
boolean$isCommandLineMode

◆ isDeferrableUpdate()

SMW\MediaWiki\Deferred\CallableUpdate::isDeferrableUpdate (   $isDeferrableUpdate)
Note
Unit/Integration tests in MW 1.26- showed ambiguous behaviour when run in deferred mode because not all MW operations were supporting late execution.
Since
3.0

◆ markAsPending()

SMW\MediaWiki\Deferred\CallableUpdate::markAsPending (   $isPending = false)
Note
If wgCommandLineMode = true (e.g. MW is in CLI mode) then DeferredUpdates::addUpdate pushes updates directly into execution mode which may not be desirable for all update processes therefore hold on to it by using an internal waitableUpdate list and release them at convenience.
Since
2.4
Parameters
booloan$isPending

◆ pushUpdate()

SMW\MediaWiki\Deferred\CallableUpdate::pushUpdate ( )
Since
2.5

◆ releasePendingUpdates()

static SMW\MediaWiki\Deferred\CallableUpdate::releasePendingUpdates ( )
static
Since
2.4

◆ setCallback()

SMW\MediaWiki\Deferred\CallableUpdate::setCallback ( callable  $callback)
Since
3.0
Parameters
callable$callback

◆ setFingerprint()

SMW\MediaWiki\Deferred\CallableUpdate::setFingerprint (   $fingerprint = null)
Note
Set a fingerprint allowing it to track and detect duplicate update requests while being unprocessed.
Since
2.5
Parameters
string | null$queue

◆ setOrigin()

SMW\MediaWiki\Deferred\CallableUpdate::setOrigin (   $origin)
Since
2.5
Parameters
string$origin

Member Data Documentation

◆ STAGE_POSTSEND

const SMW\MediaWiki\Deferred\CallableUpdate::STAGE_POSTSEND = 'post'

Updates that should run after flushing output buffer

◆ STAGE_PRESEND

const SMW\MediaWiki\Deferred\CallableUpdate::STAGE_PRESEND = 'pre'

Updates that should run before flushing output buffer


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

About | General disclaimer | Privacy policy