-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-actor.ts
34 lines (27 loc) · 940 Bytes
/
test-actor.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
import { Observable } from 'rxjs';
import { injectable } from 'inversify';
import { description, version, activity, scheduleToCloseTimeout, scheduleToStartTimeout, startToCloseTimeout, heartbeatTimeout } from '../../../core/actor/activity/decorators/activity-decorators';
export const TEST_ACTOR = Symbol('TEST_ACTOR');
export interface TestActor {
formatText(text: string): Observable<string>;
printIt(text: string): Observable<string>;
}
@injectable()
export class TestActorImpl implements TestActor {
private printer(text: string) {
console.log('ACTIVITY PRINTED TEXT:', text);
}
@activity()
@version('24-b')
formatText(text: string): Observable<string> {
return Observable.of(text + ' test');
}
@activity()
@version('24-b')
@description('print the text out')
printIt(text: string): Observable<string> {
return Observable.of(text).do((text: string) => {
this.printer(text);
});
}
}