1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | class JobRegistry {
|
4 | constructor() {
|
5 | this.registry = new Map();
|
6 | }
|
7 | register(name, job) {
|
8 | this.registry.set(name, job);
|
9 | }
|
10 | get(name) {
|
11 | const job = this.registry.get(name);
|
12 | if (!job) {
|
13 | throw new Error(`Unhandled job type: '${name}'.`);
|
14 | }
|
15 | return job;
|
16 | }
|
17 | }
|
18 | exports.JobRegistry = JobRegistry;
|