Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): push local backend topology changes instead of polling over IPC #19511

Closedotavio(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/19511/headopened View on GitHub

Showing 18 changed files with 35 additions and 25 deletions (loading 16).

x
0 of 18 viewed, 18 left
1 addition and 0 deletionsapps/desktop/src/backend/DesktopBackendManager.test.tsModified
View file
@@ -1585,6 +1585,7 @@
list: Effect.succeed([instance1, instance2]),
get: () => Effect.succeedNone,
primary: Effect.die(new Error("primary not implemented")),
+ changes: Stream.empty,
register: () => Effect.die(new Error("register not implemented")),
unregister: () => Effect.die(new Error("unregister not implemented")),
34 additions and 25 deletionsapps/desktop/src/backend/DesktopBackendManager.tsModified
View file
@@ -32,7 +32,7 @@
import * as FileSystem from "effect/FileSystem";
import * as Option from "effect/Option";
import * as PlatformError from "effect/PlatformError";
-import * as Ref from "effect/Ref";
+import * as SubscriptionRef from "effect/SubscriptionRef";
import * as Schedule from "effect/Schedule";
import * as Schema from "effect/Schema";
import * as Semaphore from "effect/Semaphore";
@@ -276,6 +276,10 @@
readonly stop: (options?: { readonly timeout?: Duration.Duration }) => Effect.Effect<void>;
readonly currentConfig: Effect.Effect<Option.Option<DesktopBackendStartConfig>>;
readonly snapshot: Effect.Effect<DesktopBackendSnapshot>;
+ // Emits once on subscribe and again after every lifecycle state write
+ // (start, ready, exit, restart scheduling). Writes that leave the observable
+ // config and snapshot unchanged still emit, so consumers dedupe.
+ readonly changes: Stream.Stream<void>;