From 578ebe554b586b89e7c007574a690b9efe0d9976 Mon Sep 17 00:00:00 2001 From: Maximilien Date: Wed, 12 Jun 2024 17:57:35 +0200 Subject: [PATCH] reafcto readme.md --- docs/getting-started/project-overview.md | 101 ----------------------- 1 file changed, 101 deletions(-) delete mode 100644 docs/getting-started/project-overview.md diff --git a/docs/getting-started/project-overview.md b/docs/getting-started/project-overview.md deleted file mode 100644 index 34fe43b..0000000 --- a/docs/getting-started/project-overview.md +++ /dev/null @@ -1,101 +0,0 @@ -# Getting Started - -## Project Overview - -For a step-by-step presentation of the batch library, we're going to focus on a simple requirement. -Update products and stocks via an Excel import. - - -### What is a job technically ? -A job is the class that is responsible for **what** your code is doing. - -This is the class you will have to create (or reuse), -as it contains the business logic required for what you wish to achieve. - -The only requirement is implementing [`JobInterface`](../../src/batch/src/Job/JobInterface.php), -```php - new class implements JobInterface { - public function execute(JobExecution $jobExecution): void - { - // your business logic - } - }, -]); -$jobExecutionStorage = new NullJobExecutionStorage(); - -$launcher = new SimpleJobLauncher( - new JobExecutionAccessor(new JobExecutionFactory(new UniqidJobExecutionIdGenerator()), $jobExecutionStorage), - new JobExecutor(new JobRegistry($jobs), $jobExecutionStorage, null), -); - -$execution = $launcher->launch('your.job.name', ['job' => ['configuration']]); -``` - -#### More information you need know: -##### JobExecution: - -A [JobExecution](../../src/batch/src/JobExecution.php) is the class that holds information about one execution of a job. -#### What kind of information does it hold ? - -- `JobExecution::$jobName` : The Job name (job id) -- `JobExecution::$id` : The execution id -- `JobExecution::$parameters` : Some parameters with which job was executed -- `JobExecution::$status` : A status (pending, running, stopped, completed, abandoned, failed) -- `JobExecution::$startTime` : Start time -- `JobExecution::$endTime` : End time -- `JobExecution::$failures` : A list of failures (usually exceptions) -- `JobExecution::$warnings` : A list of warnings (usually skipped items) -- `JobExecution::$summary` : A summary (can contain any data you wish to store) -- `JobExecution::$logs` : Some logs -- `JobExecution::$childExecutions` : Some child execution - -#### JobExecutionStorage - -Whenever a job is launched, whether is starts immediately or not, an execution is stored for it. -The execution are stored to allow you to keep an eye on what is happening. -This persistence is on the responsibility of the job execution storage. -- [Job Execution Storage](../batch/domain/job-execution-storage.md)