Configuring Retries and Failures
- public function getRequiredLeaseTime() — Return the number of seconds this worker needs hold a lease on the task for while it performs work. For most tasks you can leave this at `null`, which will give you a default lease (currently 2 hours).
- public function getMaximumRetryCount() — By default, Doorkeeper workers perform a small number of retries with exponential backoff. A consideration in this policy is that many of these workers are laden with side effects.
- public function getWaitBeforeRetry($task) — See @{method:getMaximumRetryCount} for a description of Doorkeeper retry defaults.
Publishing Stories
- abstract protected function publishFeedStory() — Actually publish the feed story. Subclasses will generally make API calls to publish some version of the story into external systems.
- abstract public function isEnabled() — Enable or disable the worker. Normally, this checks configuration to see if Phabricator is linked to applicable external systems.
Story Context
- protected function getFeedStory() — Get the @{class:PhabricatorFeedStory} that should be published.
- protected function getViewer() — Get the viewer for the act of publishing.
- protected function getPublisher() — Get the @{class:DoorkeeperFeedStoryPublisher} which handles this object.
- protected function getStoryObject() — Get the primary object the story is about, like a @{class:DifferentialRevision} or @{class:ManiphestTask}.
Internals
- private function loadPublisher() — Load the @{class:DoorkeeperFeedStoryPublisher} which corresponds to this object. Publishers provide a common API for pushing object updates into foreign systems.
Other Methods
- public function setCurrentWorkerTask($task)
- public function getCurrentWorkerTask()
- public function getCurrentWorkerTaskID()
- final protected function doWork() — Doorkeeper workers set up some context, then call @{method:publishFeedStory}.
- final public function __construct($data)
- final protected function getTaskData()
- final protected function getTaskDataValue($key, $default)
- final public function executeTask()
- final public static function scheduleTask($task_class, $data, $options)
- public function renderForDisplay($viewer)
- public static function setRunAllTasksInProcess($all) — Set this flag to execute scheduled tasks synchronously, in the same process. This is useful for debugging, and otherwise dramatically worse in every way imaginable.
- final protected function log($pattern)
- final protected function queueTask($class, $data, $options) — Queue a task to be executed after this one succeeds.
- final protected function getQueuedTasks() — Get tasks queued as followups by @{method:queueTask}.
- final public function flushTaskQueue($defaults) — Schedule any queued tasks, then empty the task queue.
- final public static function awakenTaskIDs($ids) — Awaken tasks that have yielded.
- protected function newContentSource()
- protected function loadFeedStory()