@rvkang/batch-core
v0.1.0
Published
Framework-independent contracts and helpers for nest-batch.
Maintainers
Readme
@rvkang/batch-core
Framework-independent job and step definitions, execution contracts, and the
Node-native runtime for nest-batch.
Install
pnpm add @rvkang/batch-core
pnpm add @rvkang/batch-inmemoryRun a job
import { DefaultBatchRunner, defineJob, defineStep } from "@rvkang/batch-core";
import { InMemoryBatchStorage } from "@rvkang/batch-inmemory";
const storage = new InMemoryBatchStorage();
const runner = new DefaultBatchRunner(storage);
const job = defineJob({
name: "hello",
steps: [defineStep({ name: "log", execute: async () => "done" })]
});
await runner.run(job, {});@rvkang/batch-inmemory is appropriate for tests and local examples only. Use a
durable storage adapter for restartable or multi-process work. Writers and
external side effects must be idempotent because distributed execution is
at-least-once.
Subpath APIs
Install one package and import the focused API surface that you need:
@rvkang/batch-core/queue@rvkang/batch-core/scheduler@rvkang/batch-core/polling@rvkang/batch-core/worker
