add a synchronous example

This commit is contained in:
Percs 2024-07-09 13:45:18 -05:00
parent 8015428b45
commit 7bd51538c8

View file

@ -64,3 +64,13 @@ const port = await connection.getInnerPort();
// ... transfer it to worker ... // ... transfer it to worker ...
const client = new BareClient(port); const client = new BareClient(port);
``` ```
```js
// doing this synchronously
const connection = new Ultraviolet.BareMuxConnection();
let port;
connection.getInnerPort().then((MessagePort) => {
port = MessagePort;
});
// ... transfer it to worker ...
this.bareClient = new BareClient(port)
```