Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891317
PhabricatorWorkerTask.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorWorkerTask.php
View Options
<?php
abstract
class
PhabricatorWorkerTask
extends
PhabricatorWorkerDAO
{
// NOTE: If you provide additional fields here, make sure they are handled
// correctly in the archiving process.
protected
$taskClass
;
protected
$leaseOwner
;
protected
$leaseExpires
;
protected
$failureCount
;
protected
$dataID
;
protected
$priority
;
protected
$objectPHID
;
protected
$containerPHID
;
private
$data
;
private
$executionException
;
protected
function
getConfiguration
(
)
{
return
array
(
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'taskClass'
=>
'text64'
,
'leaseOwner'
=>
'text64?'
,
'leaseExpires'
=>
'epoch?'
,
'failureCount'
=>
'uint32'
,
'failureTime'
=>
'epoch?'
,
'priority'
=>
'uint32'
,
'objectPHID'
=>
'phid?'
,
'containerPHID'
=>
'phid?'
,
)
,
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'key_object'
=>
array
(
'columns'
=>
array
(
'objectPHID'
)
,
)
,
'key_container'
=>
array
(
'columns'
=>
array
(
'containerPHID'
)
,
)
,
)
,
)
+
parent
::
getConfiguration
(
)
;
}
final
public
function
setExecutionException
(
$execution_exception
)
{
$this
->
executionException
=
$execution_exception
;
return
$this
;
}
final
public
function
getExecutionException
(
)
{
return
$this
->
executionException
;
}
final
public
function
setData
(
$data
)
{
$this
->
data
=
$data
;
return
$this
;
}
final
public
function
getData
(
)
{
return
$this
->
data
;
}
final
public
function
isArchived
(
)
{
return
(
$this
instanceof
PhabricatorWorkerArchiveTask
)
;
}
final
public
function
getWorkerInstance
(
)
{
$id
=
$this
->
getID
(
)
;
$class
=
$this
->
getTaskClass
(
)
;
try
{
// NOTE: If the class does not exist, the autoloader will throw an
// exception.
class_exists
(
$class
)
;
}
catch
(
PhutilMissingSymbolException
$ex
)
{
throw
new
PhabricatorWorkerPermanentFailureException
(
pht
(
"Task class '%s' does not exist!"
,
$class
)
)
;
}
if
(
!
is_subclass_of
(
$class
,
'PhabricatorWorker'
)
)
{
throw
new
PhabricatorWorkerPermanentFailureException
(
pht
(
"Task class '%s' does not extend %s."
,
$class
,
'PhabricatorWorker'
)
)
;
}
return
newv
(
$class
,
array
(
$this
->
getData
(
)
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 15:00 (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1116564
Default Alt Text
PhabricatorWorkerTask.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment