MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

DemoJob

MMO\core\jobs · 1 symbole · générée le 27 Oct 2026

class

DemoJob

DemoJob.php:20

A job that only counts: the example to copy, and what to run to see the jobs work end to end (a launcher, a page following it, the tests) without touching any data.

class MMO\core\jobs\DemoJob extends MMO\core\jobs\aJob
Espace de noms
MMO\core\jobs
Étend
aJob
Params: - `steps` (int, 10): how many steps; - `delay` (float, 1): seconds per step; - `failAt` (?int): throw at this step, to see a failure; - `report` (bool, true): end with an html report.
$id = JobStore::Shared()->start(DemoJob::class, ['steps' => 30, 'delay' => 0.5]);

Index

Exclusive() staticSeveral demo jobs may run at once.
run($params)
Title() static

Méthodes3

Exclusive()

staticDemoJob.php:26

Several demo jobs may run at once.

static function Exclusive(): bool
retournebool
Membres hérités (55)
ConstantesDéclaré parDescription
ALERTiLogLevelAlert: Action must be taken immediately.
ALLiLogLevelMask for all
ALL_PLUSiLogLeveldebug everything
BACKTRACEiLogLevel
CRITICALiLogLevelCritical: Critical conditions.
DEBUGiLogLevelDebug: Detailed debug information.
DEEPiLogLeveldebug everything with arguments
EMERGENCYiLogLevelEmergency: System is unusable.
ERRORiLogLevelError: Runtime errors that do not require immediate action but should typically be logged and monitored.
ERROR_PLUSiLogLevelMask for all error
FATALiLogLevelMask for all fatal error
INFOiLogLevelInfo: Interesting events.
INFO_PLUSiLogLevelMask for all errors/warning/notices/info
MEMORYiLogLevelinclude backtrace object
NOTICEiLogLevelNotice: Normal but significant events.
NOTICE_PLUSiLogLevelMask for all errors/warning/notices/info
TRACEiLogLevelinclude backtrace as origins
WARNINGiLogLevelWarning: Exceptional occurrences that are not errors.
WARNING_PLUSiLogLevelMask for all errors and warnings
PropriétésDéclaré parDescription
heartbeatIntervalaJob
idaJob
lastHeartbeataJob
lastProgressaJob
otherVerbosityaJob
progressaJob
progressIntervalaJob
progressSentaJob
stoppedaJob
storeaJob
verbosityaJob
MéthodesDéclaré parDescription
alert($message, $context)aJobAction must be taken immediately.
backtraces($message, $context)aJobForce-log a message at INFO level together with a full stack trace/memory snapshot (iLogLevel::BACKTRACE), bypassing the verbosity mask entirely (any non-zero verbosity is enough to trigger it).
critical($message, $context)aJobCritical conditions. No-op if CRITICAL is currently filtered out by the verbosity mask.
debug($message, $context)aJobDetailed debug information.
debugName()aJob
emergency($message, $context)aJobSystem is unusable. No-op if EMERGENCY is currently filtered out by the verbosity mask.
emit($type, $data)aJobAdd an event of any type to the job's events (JobStore::emit).
error($message, $context)aJobRuntime errors that do not require immediate action but should typically be logged and monitored.
flushProgress($record)aJobSend the last progress if progress skipped it (what the job ends with).
getId()aJob
getStore()aJob
getVerbosity()aJob
heartbeat($changes, $force)aJobRefresh the record's heartbeat (with $changes), at most every $heartbeatInterval seconds.
html($html)aJobShow an html fragment as is (a report, a table): the people following the job see it in its log.
info($message, $context)aJobInteresting events. No-op if INFO is currently filtered out by the verbosity mask.
isStopped()aJob
log($level, $message, $context)aJobLogs with an arbitrary level.
notice($message, $context)aJobNormal but significant events.
progress($done, $total, $label)aJobSay how far the job is.
requestStop()aJobAsk the job to stop from inside its own process (what JobRunner does on SIGTERM).
setVerbosity($verb)aJobSet the current verbosity mask, replacing whatever it was before.
shouldStop()aJobWhether the job was asked to stop (JobStore::stop, or SIGTERM): call it in loops, and return when true.
testVerbosity($level)aJobTest whether a given level (or set of levels) is currently enabled by this instance's verbosity mask.
warning($message, $context)aJobExceptional occurrences that are not errors.
__construct($store, $id)aJob