Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/64046


Change subject: document NullJob example usage
......................................................................

document NullJob example usage

This provide a very simple example to use NullJob class for test
purposes.

Change-Id: I04fa83d4e143451c290f0978ff25b20e9dbe8bef
---
M includes/job/jobs/NullJob.php
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/64046/1

diff --git a/includes/job/jobs/NullJob.php b/includes/job/jobs/NullJob.php
index d282a8e..b6164a5 100644
--- a/includes/job/jobs/NullJob.php
+++ b/includes/job/jobs/NullJob.php
@@ -26,6 +26,22 @@
  * in the queue and/or sleep for a brief time period. These can be used
  * to represent "no-op" jobs or test lock contention and performance.
  *
+ * @par Example:
+ * Inserting a null job in the configured job queue:
+ * @code
+ * $ php maintenance/eval.php
+ * > $queue = JobQueueGroup::singleton();
+ * > $job = new NullJob( Title::newMainPage(), array( 'lives' => 10 ) );
+ * > $queue->push( $job );
+ * @endcode
+ * You can then confirm the job has been enqueued by using the showJobs.php
+ * maintenance utility:
+ * @code
+ * $ php maintenance/showJobs.php --group
+ * null: 1 queue; 0 claimed (0 active, 0 abandoned)
+ * $
+ * @endcode
+ *
  * @ingroup JobQueue
  */
 class NullJob extends Job {

-- 
To view, visit https://gerrit.wikimedia.org/r/64046
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I04fa83d4e143451c290f0978ff25b20e9dbe8bef
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to