public static function Job::create in Advanced Queue 8
Creates a new job, ready to be queued.
Parameters
string $type: The job type.
array $payload: The payload.
Return value
static
7 calls to Job::create()
- DatabaseBackendTest::testFutureQueue in tests/
src/ Kernel/ DatabaseBackendTest.php - @covers ::enqueueJob @covers ::claimJob
- DatabaseBackendTest::testQueue in tests/
src/ Kernel/ DatabaseBackendTest.php - @covers ::deleteQueue @covers ::countJobs @covers ::enqueueJob @covers ::enqueueJobs @covers ::claimJob @covers ::onSuccess @covers ::onFailure @covers ::deleteJob
- DatabaseBackendTest::testQueueCleanup in tests/
src/ Kernel/ DatabaseBackendTest.php - @covers ::cleanupQueue
- JobTest::testCreate in tests/
src/ Unit/ JobTest.php - @covers ::create @covers ::getType @covers ::getPayload @covers ::getState
- ProcessorTest::retryJobProvider in tests/
src/ Kernel/ ProcessorTest.php - Data provider for ::testRetry.
File
- src/
Job.php, line 126
Class
- Job
- Represents a job.
Namespace
Drupal\advancedqueueCode
public static function create($type, array $payload) {
return new static([
'type' => $type,
'payload' => $payload,
'state' => self::STATE_QUEUED,
]);
}