|
3 | 3 | // DI-resolved configuration (RpcRegistryOptions, PeerOptions, InboundCallOptions, |
4 | 4 | // OutboundCallOptions, DiagnosticsOptions), SerializationFormats, Middlewares, |
5 | 5 | // ClientPeerReconnectDelayer, Limits, SystemClock. |
6 | | -// Manages peers via ConcurrentDictionary<RpcPeerRef, RpcPeer> with GetPeer() |
| 6 | +// Manages peers via ConcurrentDictionary<RpcRoute, RpcPeer> with GetPeer() |
7 | 7 | // that lazily creates + starts peers. Also has GetClient<T>() / GetServer<T>() |
8 | 8 | // that look up services in ServiceRegistry. |
9 | 9 | // |
|
15 | 15 | // addService() / addClient() calls. |
16 | 16 | // - GetClient<T>() / GetServer<T>() — .NET resolves typed client/server proxies |
17 | 17 | // via the ServiceRegistry + DI. TS uses addClient<T>(peer, def). |
18 | | -// - RpcPeerRef-keyed peer dictionary — .NET peers are keyed by RpcPeerRef (rich |
19 | | -// value object encoding route, version, serialization format). TS uses string |
20 | | -// refs (URL for clients, "server://{uuid}" for servers). |
| 18 | +// - RpcRoute-keyed peer dictionary — .NET peers are keyed by RpcRoute (one |
| 19 | +// route generation of a stable RpcRef, which encodes client/server, versions, |
| 20 | +// serialization format). TS uses string refs (URL for clients, |
| 21 | +// "server://{uuid}" for servers). |
21 | 22 | // - Lazy peer creation + Start() — .NET's GetPeer auto-creates and starts a |
22 | 23 | // peer's reconnection loop. TS requires explicit addPeer() + run(). |
23 | 24 | // - DisposeAsync — .NET disposes all peers on hub shutdown. TS has close(). |
24 | | -// - Route change detection (RouteState.WhenChanged → Dispose peer) — .NET |
25 | | -// watches for load-balancer route changes and auto-disposes stale peers. |
| 25 | +// - Route change detection (RpcRoute.WhenChanged → Dispose peer) — .NET |
| 26 | +// watches for topology changes and auto-disposes stale-route peers. |
26 | 27 | // TS has no routing layer. |
27 | 28 | // - Middlewares (IRpcMiddleware[]) — ordered middleware pipeline for inbound |
28 | 29 | // calls. TS dispatches directly to service implementations. |
@@ -52,7 +53,7 @@ import { RpcSystemCalls } from './rpc-message.js'; |
52 | 53 | const { warnLog } = getLogs('RpcHub'); |
53 | 54 |
|
54 | 55 | /** Factory signature shared by all peer lookup/creation methods. Serialization |
55 | | - * format is encoded in the URL via `?f=...` (see {@link RpcPeerRefBuilder}), |
| 56 | + * format is encoded in the URL via `?f=...` (see {@link RpcRefBuilder}), |
56 | 57 | * so the factory doesn't need an extra parameter for it. `getClientPeer` / |
57 | 58 | * `getServerPeer` cast the result, so the factory returns RpcPeer. */ |
58 | 59 | export type RpcPeerFactory = (hub: RpcHub, ref: string) => RpcPeer; |
|
0 commit comments