1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { BaseException, JsonValue, logging } from '@angular-devkit/core';
|
9 | import { Observable, Observer } from 'rxjs';
|
10 | import { JobDescription, JobHandler, JobHandlerContext } from './api';
|
11 | export declare class ChannelAlreadyExistException extends BaseException {
|
12 | constructor(name: string);
|
13 | }
|
14 | /**
|
15 | * Interface for the JobHandler context that is used when using `createJobHandler()`. It extends
|
16 | * the basic `JobHandlerContext` with additional functionality.
|
17 | */
|
18 | export interface SimpleJobHandlerContext<A extends JsonValue, I extends JsonValue, O extends JsonValue> extends JobHandlerContext<A, I, O> {
|
19 | createChannel: (name: string) => Observer<JsonValue>;
|
20 | input: Observable<I>;
|
21 | addTeardown(teardown: () => Promise<void> | void): void;
|
22 | }
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | export type SimpleJobHandlerFn<A extends JsonValue, I extends JsonValue, O extends JsonValue> = (input: A, context: SimpleJobHandlerContext<A, I, O>) => O | Promise<O> | Observable<O>;
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | export declare function createJobHandler<A extends JsonValue, I extends JsonValue, O extends JsonValue>(fn: SimpleJobHandlerFn<A, I, O>, options?: Partial<JobDescription>): JobHandler<A, I, O>;
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | export declare function createJobFactory<A extends JsonValue, I extends JsonValue, O extends JsonValue>(loader: () => Promise<JobHandler<A, I, O>>, options?: Partial<JobDescription>): JobHandler<A, I, O>;
|
43 |
|
44 |
|
45 |
|
46 |
|
47 | export declare function createLoggerJob<A extends JsonValue, I extends JsonValue, O extends JsonValue>(job: JobHandler<A, I, O>, logger: logging.LoggerApi): JobHandler<A, I, O>;
|