From f13d713cd8339f2f4493607a811cd09a043eef00 Mon Sep 17 00:00:00 2001 From: Daniel Nagy <1622446+daniel-nagy@users.noreply.github.com> Date: Thu, 1 Aug 2024 16:40:44 -0500 Subject: [PATCH] Beta 6 (#9) --- .tool-versions | 2 +- bun.lockb | Bin 190400 -> 191008 bytes packages/browser/package.json | 2 +- packages/browser/web-test-runner.config.js | 4 +-- packages/core/README.md | 4 +-- packages/core/package.json | 4 +-- packages/core/src/ClientAgent.ts | 2 +- packages/core/src/Fiber.ts | 20 +++++++++-- packages/core/src/Message.ts | 9 ++--- packages/core/src/Metadata.ts | 4 +-- packages/core/src/PubSub.ts | 16 ++++++++- packages/core/src/Session.test.ts | 37 +++++++++++++++++---- packages/core/src/Session.ts | 3 +- packages/core/src/UUID.test.ts | 9 +++++ packages/core/src/UUID.ts | 29 ++++++++++++++++ 15 files changed, 119 insertions(+), 26 deletions(-) create mode 100644 packages/core/src/UUID.test.ts create mode 100644 packages/core/src/UUID.ts diff --git a/.tool-versions b/.tool-versions index 2263cc3..199cf09 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -bun 1.0.17 +bun 1.1.21 diff --git a/bun.lockb b/bun.lockb index 24424dc7bce05d9a6f84d6829042d2c12fd86eb7..104e45da72b274689b11fa161d96fab080102b50 100755 GIT binary patch delta 22180 zcmbV!30zgx_WwCYE^N~^;%*A=X}rAYMo zZtXP1ffcSPb+4on^Dl4bCl=2B97q5DP?+eFJ(y z^shjwcLzuv4MurupcAmCG)J<}E)Fiu$j_59igM;=6cyWkZE1QWI47@grql z0ZrPAa`THa;7Q&jx;tLaPy))6+6n17w$cUUg!=Y^&d$pyDY0cqZ$S%n(pEgbBo{W= zis#L@6_rZf9fej~G5il(cS82Ls!nd~Qa`tY8?LIV&S?4$2Q=bg13~AeE2Q zGg^3;f7V5`a1@At_8e&M1e^#Ye`IGAm&`-$BHR4p-0V_meOF<*t(&lPKahGn0Z8(( zsOJUr0(t^(gFqE~2hikK2Se{gZ?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ItV80?_=ZUq?`*$97v01==iNpsN zJi)g=1sSz2d>at%u5jTF%ru7eQyro&7rC19AeCU%k0V}lq5{DN8kACp^>m#wL z;`49$0XIId`g*)JLT|*k8SM~FT!BA0k{|vugFe`TT(sCQ0RtT&zMX)GvR?_YuhZz{ zXMSCH$_hEG`*KrtVm}?13M>Eq)7t+~-o^D_KdHx21z&>8?zrrCO038p85})7M{pC>#1ee|zM4CNoPBTJsN`;iR(aLlSN^zd>G!dVLAOWwvPB0+e4QWdW50Ch&8A)- znCHC7TmP~R^q!7&%>JnUk$kH z)n3m};Z8kqLfkV=Tei9VbnT6`E#@yS7Hev>P%-3tEwu%9A@N$N79uV@gAT=uVNamM zsSB) diff --git a/packages/browser/package.json b/packages/browser/package.json index b6a9222..0753dc9 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -1,7 +1,7 @@ { "name": "@daniel-nagy/transporter-browser", "type": "module", - "version": "1.0.0-beta.5", + "version": "1.0.0-beta.6", "description": "Typesafe distributed computing in the browser.", "author": "Daniel Nagy <1622446+daniel-nagy@users.noreply.github.com>", "repository": "github:daniel-nagy/transporter", diff --git a/packages/browser/web-test-runner.config.js b/packages/browser/web-test-runner.config.js index b0d4c1c..16dbb0c 100644 --- a/packages/browser/web-test-runner.config.js +++ b/packages/browser/web-test-runner.config.js @@ -2,8 +2,8 @@ import { esbuildPlugin } from "@web/dev-server-esbuild"; import { playwrightLauncher } from "@web/test-runner-playwright"; import ts from "typescript"; -import tsConfigBase from "./tsconfig-base.json" assert { type: "json" }; -import tsConfigTest from "./tsconfig-test.json" assert { type: "json" }; +import tsConfigBase from "./tsconfig-base.json" with { type: "json" }; +import tsConfigTest from "./tsconfig-test.json" with { type: "json" }; /** * @type import("@web/test-runner").TestRunnerConfig diff --git a/packages/core/README.md b/packages/core/README.md index eb2966d..3d61128 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -784,9 +784,9 @@ The Metadata module allows information to be extracted from a proxy. ```ts type Metadata = { /** - * The address of the server that provides the value. + * The id of the client agent managing this proxy. */ - address: string; + clientAgentId: string; /** * The path to the value in the original object. */ diff --git a/packages/core/package.json b/packages/core/package.json index 4b69ef1..f54a413 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@daniel-nagy/transporter", "type": "module", - "version": "1.0.0-beta.5", + "version": "1.0.0-beta.6", "description": "Typesafe distributed computing in TypeScript.", "author": "Daniel Nagy <1622446+daniel-nagy@users.noreply.github.com>", "repository": "github:daniel-nagy/transporter", @@ -46,7 +46,7 @@ "@types/sinonjs__fake-timers": "^8.1.5", "@typescript-eslint/eslint-plugin": "^6.7.5", "@typescript-eslint/parser": "^6.7.5", - "bun-types": "^1.0.6", + "bun-types": "^1.1.21", "eslint": "^8.51.0", "eslint-plugin-expect-type": "^0.2.3", "eslint-plugin-require-extensions": "^0.1.3", diff --git a/packages/core/src/ClientAgent.ts b/packages/core/src/ClientAgent.ts index 8d87bef..a2414bc 100644 --- a/packages/core/src/ClientAgent.ts +++ b/packages/core/src/ClientAgent.ts @@ -131,7 +131,7 @@ export class ClientAgent extends Fiber.t { const children: Record = {}; const meta: Metadata.t = { - address: this.serverAddress, + clientAgentId: this.id, objectPath: path }; diff --git a/packages/core/src/Fiber.ts b/packages/core/src/Fiber.ts index 1cd69b6..ac42d11 100644 --- a/packages/core/src/Fiber.ts +++ b/packages/core/src/Fiber.ts @@ -1,7 +1,13 @@ import * as BehaviorSubject from "./BehaviorSubject.js"; +import * as UUID from "./UUID.js"; export { Fiber as t }; +/** + * Keeps track of all active fibers. + */ +const table = new Map(); + /** * A fiber's state. */ @@ -30,8 +36,10 @@ export class Fiber { /** * A unique identifier for this fiber. */ - public readonly id: string = crypto.randomUUID() - ) {} + public readonly id: string = UUID.v4() + ) { + table.set(id, this); + } /** * Terminates the fiber. The fiber's state will transition to `Terminated` and @@ -40,6 +48,7 @@ export class Fiber { terminate() { this.#state.next(State.Terminated); this.#state.complete(); + table.delete(this.id); } [Symbol.dispose]() { @@ -47,6 +56,13 @@ export class Fiber { } } +/** + * Get a reference to a Fiber from its id. + */ +export const get = (id: string): T | null => { + return (table.get(id) as T) ?? null; +}; + /** * Creates a new `Fiber`. */ diff --git a/packages/core/src/Message.ts b/packages/core/src/Message.ts index 6e007bc..cc96f59 100644 --- a/packages/core/src/Message.ts +++ b/packages/core/src/Message.ts @@ -1,4 +1,5 @@ import * as JsObject from "./JsObject.js"; +import * as UUID from "./UUID.js"; /** * Flattens an intersection type into a single type. @@ -89,7 +90,7 @@ export type CallFunction = FlattenIntersection< export const CallFunction = ({ address, args, - id = crypto.randomUUID(), + id = UUID.v4(), noReply = false, path }: { @@ -122,7 +123,7 @@ export type Error = FlattenIntersection< export const Error = ({ address, error, - id = crypto.randomUUID() + id = UUID.v4() }: { address: string; error: T; @@ -147,7 +148,7 @@ export type GarbageCollect = FlattenIntersection< */ export const GarbageCollect = ({ address, - id = crypto.randomUUID() + id = UUID.v4() }: { address: string; id?: string; @@ -171,7 +172,7 @@ export type SetValue = FlattenIntersection< */ export const SetValue = ({ address, - id = crypto.randomUUID(), + id = UUID.v4(), value }: { address: string; diff --git a/packages/core/src/Metadata.ts b/packages/core/src/Metadata.ts index c0dc36d..1445d9d 100644 --- a/packages/core/src/Metadata.ts +++ b/packages/core/src/Metadata.ts @@ -9,9 +9,9 @@ export const symbol = Symbol.for("metadata"); */ export type Metadata = { /** - * The address of the server that provides the value. + * The id of the client agent managing this proxy. */ - address: string; + clientAgentId: string; /** * The path to the value in the original object from the dereferenced value. */ diff --git a/packages/core/src/PubSub.ts b/packages/core/src/PubSub.ts index f1c2e85..61d68fd 100644 --- a/packages/core/src/PubSub.ts +++ b/packages/core/src/PubSub.ts @@ -1,3 +1,5 @@ +import * as Fiber from "./Fiber.js"; +import * as Metadata from "./Metadata.js"; import * as Observable from "./Observable/index.js"; /** @@ -36,10 +38,22 @@ export function from(observable: Observable.ObservableLike): PubSub { subscribe: async ( observer: AsyncObserver | ((value: T) => Promise) ) => { + const metadata = Metadata.get(observer); + const agent = metadata && Fiber.get(metadata.clientAgentId); const subscription = observable.subscribe(observer); + const innerSubscription = agent?.stateChange.subscribe((state) => { + switch (state) { + case Fiber.State.Terminated: + subscription.unsubscribe(); + } + }); + return { - unsubscribe: async () => subscription.unsubscribe() + unsubscribe: async () => { + innerSubscription?.unsubscribe(); + subscription.unsubscribe(); + } }; } }; diff --git a/packages/core/src/Session.test.ts b/packages/core/src/Session.test.ts index 3a76a15..a4b196b 100644 --- a/packages/core/src/Session.test.ts +++ b/packages/core/src/Session.test.ts @@ -1,6 +1,7 @@ import { afterEach, describe, expect, test } from "bun:test"; import { spy, spyOn } from "tinyspy"; +import * as BehaviorSubject from "./BehaviorSubject.js"; import * as Cache from "./Cache.js"; import * as Fiber from "./Fiber.js"; import * as Injector from "./Injector.js"; @@ -9,9 +10,12 @@ import * as Message from "./Message.js"; import * as Metadata from "./Metadata.js"; import * as Observable from "./Observable/index.js"; import * as Proxy from "./Proxy.js"; +import * as PubSub from "./PubSub.js"; import * as Session from "./Session.js"; import * as Subprotocol from "./Subprotocol.js"; +const UUID = expect.stringMatching(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/) as string; + afterEach(() => { Session.rootSupervisor.tasks.forEach((task) => task.terminate()); }); @@ -256,12 +260,12 @@ describe("proxied objects", () => { const { proxy, dispose } = expose({ bar: async () => {} }); expect(Metadata.get(proxy)).toEqual({ - address: "", + clientAgentId: UUID, objectPath: [] }); expect(Metadata.get(proxy.bar)).toEqual({ - address: "", + clientAgentId: UUID, objectPath: ["bar"] }); @@ -284,9 +288,7 @@ describe("proxied objects", () => { const childProxy = await proxy(); expect(Metadata.get(childProxy)).toEqual({ - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - address: expect.stringMatching(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/), + clientAgentId: UUID, objectPath: [] }); @@ -295,12 +297,33 @@ describe("proxied objects", () => { }); }); +describe("pub/sub", () => { + test("A pub/sub is unsubscribed when the session is terminated", async () => { + const counter = BehaviorSubject.of(0); + const unsubscribe = spy(); + + spyOn(counter, "subscribe", () => ({ unsubscribe })); + + const { dispose, proxy, server } = expose({ + Chat: { counter: PubSub.from(counter) } + }); + + proxy.Chat.counter.subscribe(async () => {}); + + await scheduleTask(); + server.terminate(); + + expect(unsubscribe.callCount).toBe(1); + dispose(); + }); +}); + describe("reflection", () => { test("the root proxy", () => { const { proxy, dispose } = expose(async () => {}); expect(Metadata.get(proxy)).toEqual({ - address: "", + clientAgentId: UUID, objectPath: [] }); @@ -311,7 +334,7 @@ describe("reflection", () => { const { proxy, dispose } = expose({ a: async () => {} }); expect(Metadata.get(proxy.a)).toEqual({ - address: "", + clientAgentId: UUID, objectPath: ["a"] }); diff --git a/packages/core/src/Session.ts b/packages/core/src/Session.ts index 9838ece..076e475 100644 --- a/packages/core/src/Session.ts +++ b/packages/core/src/Session.ts @@ -11,6 +11,7 @@ import * as ServerAgent from "./ServerAgent.js"; import * as Subject from "./Subject.js"; import * as Subprotocol from "./Subprotocol.js"; import * as Supervisor from "./Supervisor.js"; +import * as UUID from "./UUID.js"; export { Session as t }; @@ -113,7 +114,7 @@ export abstract class Session< protected createServer( this: Session, provide: unknown, - address: string = crypto.randomUUID() + address: string = UUID.v4() ): ServerAgent.t { const serverAgent = ServerAgent.init({ address, diff --git a/packages/core/src/UUID.test.ts b/packages/core/src/UUID.test.ts new file mode 100644 index 0000000..516594a --- /dev/null +++ b/packages/core/src/UUID.test.ts @@ -0,0 +1,9 @@ +import { expect, test } from "bun:test"; + +import * as UUID from "./UUID.js"; + +test("generating a v4 UUID", () => { + expect(UUID.v4()).toEqual( + expect.stringMatching(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/) + ); +}); diff --git a/packages/core/src/UUID.ts b/packages/core/src/UUID.ts new file mode 100644 index 0000000..b0c07f8 --- /dev/null +++ b/packages/core/src/UUID.ts @@ -0,0 +1,29 @@ +function hex(bits: number) { + if (bits > 53) throw new Error("bits must be less than or equal to 53"); + + return Math.floor(Math.random() * (2 ** bits - 1)) + .toString(16) + .padStart(Math.ceil(bits / 4), "0"); +} + +/** + * Generates a v4 UUID. This implementation generates exactly 122 bits of random + * data and concatenates the version and variant. + * + * @see https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4 + */ +function v4Fallback(): string { + const a = hex(48); + const b = hex(12); + const c = `${hex(31)}${hex(31)}`; + + return `${a.slice(0, 8)}-${a.slice(8)}-4${b}-a${c.slice(0, 3)}-${c.slice( + 3, + 15 + )}`; +} + +export const v4 = + typeof crypto !== "undefined" && typeof crypto.randomUUID !== "undefined" + ? crypto.randomUUID.bind(crypto) + : v4Fallback;