|
@@ -0,0 +1,56 @@
|
|
|
+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.")
|
|
|
+ }
|
|
|
+
|
|
|
+}
|