Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 1a0c12f

Browse files
committed
Add defining batches.
1 parent 940e6d8 commit 1a0c12f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/pages/jobs.mdx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Job definitions are defined as a part of batches and represent a single unit of
1818

1919
A Job is an instance of a Job Definition that is running within a `Batch`, these can be created from Nitric services or other Nitric batches.
2020

21-
## Limitations of Jobs
21+
## Limitations of Batches
2222

2323
Jobs are designed to be long running HPC workloads and can take some time to spin up. They are not designed with reactivity in mind and are not suitable for responding to events from cloud resources.
2424

@@ -31,8 +31,22 @@ Jobs are unable to run the following:
3131

3232
Jobs can be used to read and write to/from all nitric resources.
3333

34+
## Defining Batches
35+
36+
Batches are defined in a similar way to services, within the `nitric.yaml` file. As an example
37+
38+
```yaml
39+
batches:
40+
- match: ./batches/*.ts
41+
start: yarn dev:batches $BATCH_PATH
42+
```
43+
44+
> A Batch can contain any number of Job Definitions.
45+
3446
## Defining a Job
3547
48+
Within a Batch we define Job Definitions, which describes the code we will execute in each job.
49+
3650
<CodeGroup>
3751
3852
```typescript

0 commit comments

Comments
 (0)