File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
packages/sequencer/src/worker/worker Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { injectable } from "tsyringe" ;
2
2
import { injectOptional } from "@proto-kit/common" ;
3
3
4
+ import { SequencerStartupModule } from "../../sequencer/SequencerStartupModule" ;
5
+
4
6
import { LocalTaskWorkerModule } from "./LocalTaskWorkerModule" ;
5
7
6
8
/**
@@ -13,8 +15,19 @@ export class WorkerReadyModule {
13
15
@injectOptional ( "LocalTaskWorkerModule" )
14
16
private readonly localTaskWorkerModule :
15
17
| LocalTaskWorkerModule < any >
16
- | undefined
17
- ) { }
18
+ | undefined ,
19
+ @injectOptional ( "SequencerStartupModule" )
20
+ private readonly sequencerStartupModule : SequencerStartupModule | undefined
21
+ ) {
22
+ if (
23
+ localTaskWorkerModule !== undefined &&
24
+ sequencerStartupModule === undefined
25
+ ) {
26
+ throw new Error (
27
+ "The LocalTaskWorkerModule requires the SequencerStartupModule to be defined as well."
28
+ ) ;
29
+ }
30
+ }
18
31
19
32
// eslint-disable-next-line consistent-return
20
33
public async waitForReady ( ) {
You can’t perform that action at this time.
0 commit comments