Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation index #126

Merged
merged 11 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

This repository contains sources for all packages from `yokai/batch` suite.

## Documentation

You should start with [centralized documentation](https://github.com/yokai-php/batch-src/blob/0.x/docs/README.md).

## Packages

Expand All @@ -30,12 +33,6 @@ And some special packages :
- [`yokai/batch-symfony-pack`](https://github.com/yokai-php/batch-symfony-pack): Minimal pack for Symfony Framework


## Documentation

Every package has its own documentation,
you should start with [core repository documentation](https://github.com/yokai-php/batch/blob/0.x/README.md).


## Contribution

Please feel free to open an [issue](https://github.com/yokai-php/batch-src/issues)
Expand Down
64 changes: 64 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
## Installation

```bash
composer require yokai/batch
```

## What is Batch ?
The Batch library solves all your massive data processing problems.

Batch can also be used as an ETL.

Batch can also work asynchronously.

Batch help you to make reporting during process.

## How it works ?
Batch is a library that allows you to declare and execute jobs.
And having control over each step of the process to be able to extend the technical logic to meet business needs.

## Vocabulary

Because when you start with any library
it is important to understand what are the concepts introduced in it.

This is highly recommended that you read this entire page
before starting to work with this library.

### Job
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),

#### See More:
For more information about jobs, see [Job](batch/domain/job.md)

### Job Launcher

The job launcher is responsible for executing/scheduling every jobs.

Yeah, executing OR scheduling. There is multiple implementation of a job launcher across bridges.
Job's execution might be asynchronous, and thus, when you ask the job launcher to "launch" a job,
you have to check the `JobExecution` status that it had returned to know if the job is already executed.

#### What is needed to use a Job Launcher ?

For use a Job Launcher you need to have:
- **A Container of Jobs:** A container use any PSR-11 [container implementation](https://packagist.org/providers/psr/container-implementation)
- **A Storage for Job Executions:** A storage to store the execution of jobs, it can be a database, a file, a cache, etc.
- **A JobExecutor:** The executor will execute the job.
- **A JobExecutionAccessor:** The accessor will access the job execution.

### JobExecution:

A [JobExecution](../src/batch/src/JobExecution.php) is the class that holds information about one execution of a job.

### 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)
Loading