-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
ActorInit.ts
57 lines (52 loc) 路 1.47 KB
/
ActorInit.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import type { IAction, IActorOutput, IActorTest, IActorArgs, Mediate } from '@comunica/core';
import { Actor } from '@comunica/core';
import type { Readable } from 'readable-stream';
/**
* A base actor for listening to init events.
*
* Actor types:
* * Input: IActionInit: Contains process information
* such as the list of arguments,
* environment variables and input stream.
* * Test: <none>
* * Output: IActorOutputInit: Contains process output streams.
*
* @see IActionInit
*/
export abstract class ActorInit extends Actor<IActionInit, IActorTest, IActorOutputInit> {
/**
* @param args - @defaultNested {<default_bus> a <cc:components/Bus.jsonld#Bus>} bus
*/
public constructor(args: IActorInitArgs) {
super(args);
}
}
/**
* The init input, which contains the program arguments.
*/
export interface IActionInit extends IAction {
/**
* The list of program arguments.
*/
argv: string[];
/**
* The mapping of environment variables.
*/
env: Record<string, string | undefined>;
/**
* A standard input stream.
*/
stdin: Readable;
}
export interface IActorOutputInit extends IActorOutput {
/**
* A standard error output stream.
*/
stderr?: Readable;
/**
* A standard output stream.
*/
stdout?: Readable;
}
export type IActorInitArgs = IActorArgs<IActionInit, IActorTest, IActorOutputInit>;
export type MediatorInit = Mediate<IActionInit, IActorOutputInit>;