1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import { Observer, Subject, Subscribable, Unsubscribable } from "rxjs"
- /* --------------------------------------------
- Fis actor to declare its own subscribable but extended from RXJS
- */
- interface ActorService { }
- /* Stateful actor service to be instantiated by concrete class.
- To add in behaviour and model state repository */
- interface ActorContext { }
- /* references to associate actors */
- // Please note members of an interface are ALWAYS PUBLIC.
- interface FisActor<T> extends Subscribable<T> {
- actorId: String
- actorName: String
- actorContext: ActorContext
- incomingBus: Subscribable<T>
- outgoingBus: Subscribable<T>
- actorService: ActorService
- }
- export abstract class FisActorBaseImpl<T> implements FisActor<T> {
- actorId!: String
- actorName!: String
- incomingBus!: Subscribable<T>
- outgoingBus!: Subscribable<T>
- actorService!: ActorService
- actorContext!: Object
- constructor(actorContext: ActorContext) {
- // logic here
- }
- subscribe(observer: Partial<Observer<T>>): Unsubscribable {
- throw new Error("Method to be defined....")
- }
- }
- interface Actor<T> extends Subscribable<T> {
- actorId: String
- actorName: String
- actorStream: Subscribable<T>
- }
- abstract class Sample<T> implements Actor<T> {
- actorId!: String
- actorName!: String
- actorStream!: Subscribable<T>
- subscribe(observer: Partial<Observer<T>>): Unsubscribable {
- throw new Error("Method not implemented.")
- }
- }
|