mirror of
https://github.com/MercuryWorkshop/bare-mux.git
synced 2025-05-14 23:00:01 -04:00
remove broadcastchannel for workerPath, let the client pass in a messageport, use snapshot for more stuff
This commit is contained in:
parent
91f27d4c06
commit
cb443135d9
4 changed files with 32 additions and 33 deletions
|
@ -124,6 +124,10 @@ export class BareMuxConnection {
|
|||
client: functionBody,
|
||||
});
|
||||
}
|
||||
|
||||
async getInnerPort(): Promise<MessagePort> {
|
||||
return await this.worker.port;
|
||||
}
|
||||
}
|
||||
|
||||
export class BareClient {
|
||||
|
@ -132,8 +136,8 @@ export class BareClient {
|
|||
/**
|
||||
* Create a BareClient. Calls to fetch and connect will wait for an implementation to be ready.
|
||||
*/
|
||||
constructor(workerPath?: string) {
|
||||
this.worker = new WorkerConnection(workerPath);
|
||||
constructor(worker?: string | MessagePort) {
|
||||
this.worker = new WorkerConnection(worker);
|
||||
}
|
||||
|
||||
createWebSocket(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue