Skip to content

Commit

Permalink
Removed Internal register method
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed Dec 13, 2023
1 parent ca60ad1 commit b10f9ab
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
16 changes: 0 additions & 16 deletions packages/demo/src/dummy-desktop-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,8 @@ window.addEventListener("load", () => {
// for a given window, allows us to determine which app it is (if any)
const appChecker : AppChecker = o => instances.find(i => i.window == o)

// create the shared web worker
const sw = new SharedWorker('http://localhost:8080/src/server/SimpleServer.ts', {
type: "module"
})

sw.port.start()

const detailsResolver : DesktopAgentDetailResolver = (o, a) => {
const apiKey = "ABC"+ (currentApiInstance++)
sw.port.postMessage({
type: "internalRegisterAppInstance",
apiKey,
appIdentifier: {
appId: a.appId,
instanceId: a.instanceId,
desktopAgent: a.desktopAgent
}
})
return {
apiKey
}
Expand Down
7 changes: 0 additions & 7 deletions packages/demo/src/server/SimpleServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { v4 as uuidv4 } from "uuid"
import { handleHandshake } from "./handshake"
import { ConnectionStep2Hello, ConnectionStep3Handshake } from "@finos/fdc3/dist/bridging/BridgingTypes"
import { handleBroadcast } from "./broadcast"
import { handleInternalRegisterDesktopInstance } from "./internal-register"

declare var onconnect : any

Expand All @@ -22,7 +21,6 @@ export class SimpleServer {

readonly channelsState: Record<string, Context[]>
readonly clients : Map<MessagePort, ClientData> = new Map()
readonly instances: Record<string, AppIdentifier> = {}
private readonly actions : Record<string, (e: MessageEvent<any>, client: MessagePort, ss: SimpleServer) => void>

constructor(actions) {
Expand Down Expand Up @@ -56,16 +54,11 @@ export class SimpleServer {

console.log("Added client. "+this.clients.size)
}

addInstance(apiKey: string, appIdentifier: AppIdentifier) {
this.instances[apiKey] = appIdentifier
}
}

const theServer = new SimpleServer({
"hello" : handleHandshake,
"broadcastRequest": handleBroadcast,
"internalRegisterAppInstance": handleInternalRegisterDesktopInstance
});

onconnect = function (event) {
Expand Down
7 changes: 0 additions & 7 deletions packages/demo/src/server/internal-register.ts

This file was deleted.

0 comments on commit b10f9ab

Please sign in to comment.