inrupt / websockets-pubsub

WebSockets pubsub for Solid servers
https://github.com/solid/solid-spec/blob/master/api-websockets.md
MIT License
3 stars 0 forks source link

clean up interfaces between pod-server, websockets-pubsub, and wac-ldp #3

Open michielbdejong opened 5 years ago

michielbdejong commented 5 years ago

The pod-server requires both websockets-pubsub's Hub object and wac-ldp's App object.

Currently wac-ldp's Server constructor does this:

constructor (port: number, aud: string, skipWac: boolean) {
    this.port = port
    this.storage = new BlobTreeInMem() // singleton in-memory storage
    const handler = makeHandler(this.storage, aud, new URL('wss://localhost:8443'), skipWac)
    this.server = http.createServer(handler)
  }

And wac-ldp exposes BlobTree and makeHandler, but I'm thinking of changing this to:

constructor (port: number, aud: string, skipWac: boolean) {
    this.port = port
    this.storage = new BlobTreeInMem() // singleton in-memory storage
    const wacLdp = new WacLdp(this.storage, aud, new URL('wss://localhost:8443'), skipWac)
    this.server = http.createServer(wacLdp.handler.bind(wacLdp))
  }

The advantage would be:

michielbdejong commented 5 years ago

Will do this as part of #4