Browse Source

update README

enzo 1 week ago
parent
commit
23ca408ff2
4 changed files with 85 additions and 8 deletions
  1. 7 7
      README.md
  2. 56 0
      interface/interface.ts
  3. 18 0
      package-lock.json
  4. 4 1
      package.json

+ 7 - 7
README.md

@@ -1,10 +1,10 @@
-# Project Name
+# FIS-Actor
 
 [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
 
 ## Description
 
-A brief description of your project. Explain what it does, why it exists, and its primary use cases.
+Fis Actor interfaces and it's associated classes to used as building blocks of the Fis System in general.
 
 ## Features
 
@@ -16,9 +16,9 @@ A brief description of your project. Explain what it does, why it exists, and it
 
 Before you begin, ensure you have met the following requirements:
 
-- Node.js vXX.X.X or later
-- TypeScript vX.X.X or later
-- Any other required software or tools
+- Node.js v20.18.0 or later
+- TypeScript v5.7.2 or later
+- Latest Rxjs
 
 ## Installation
 
@@ -26,10 +26,10 @@ Follow these steps to install and run the project locally:
 
 ```bash
 # Clone the repository
-git clone https://github.com/your-username/your-repo-name.git
+git clone https://git.swopt.com/enzo/Fis-Actor.git
 
 # Navigate to the project directory
-cd your-repo-name
+cd Fis-Actor
 
 # Install dependencies
 npm install

+ 56 - 0
interface/interface.ts

@@ -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.")
+    }
+
+}

+ 18 - 0
package-lock.json

@@ -8,6 +8,9 @@
       "name": "fis-actor",
       "version": "1.0.0",
       "license": "ISC",
+      "dependencies": {
+        "rxjs": "^7.8.1"
+      },
       "devDependencies": {
         "@types/node": "^22.10.2",
         "ts-node": "^10.9.2",
@@ -150,6 +153,15 @@
       "dev": true,
       "license": "ISC"
     },
+    "node_modules/rxjs": {
+      "version": "7.8.1",
+      "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
+      "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
+      "license": "Apache-2.0",
+      "dependencies": {
+        "tslib": "^2.1.0"
+      }
+    },
     "node_modules/ts-node": {
       "version": "10.9.2",
       "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
@@ -194,6 +206,12 @@
         }
       }
     },
+    "node_modules/tslib": {
+      "version": "2.8.1",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+      "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+      "license": "0BSD"
+    },
     "node_modules/typescript": {
       "version": "5.7.2",
       "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz",

+ 4 - 1
package.json

@@ -13,5 +13,8 @@
     "@types/node": "^22.10.2",
     "ts-node": "^10.9.2",
     "typescript": "^5.7.2"
+  },
+  "dependencies": {
+    "rxjs": "^7.8.1"
   }
-}
+}