Download packages/chord/src/services/loopback.ts from SaylorTwift/pi: direct link, hf CLI and curl.
- Browser
- Download file 653 Bytes
-
https://huggingface.co/SaylorTwift/pi/resolve/main/packages/chord/src/services/loopback.ts
- Command line
-
hf download hf://SaylorTwift/pi/packages/chord/src/services/loopback.ts
-
curl -L -o loopback.ts https://huggingface.co/SaylorTwift/pi/resolve/main/packages/chord/src/services/loopback.ts
653 Bytes
| import type { RemoteServiceTransport } from "../types.ts"; | |
| import type { RemoteServiceProvider } from "./provider.ts"; | |
| /** Connects a provider to a binding without changing remote service semantics. */ | |
| export function createLoopbackServiceTransport(provider: RemoteServiceProvider): RemoteServiceTransport { | |
| return { | |
| invoke: (call, context) => provider.invoke(call, context), | |
| subscribe: async (serviceId, mode, listener) => { | |
| const subscription = provider.subscribe(serviceId, mode, listener); | |
| return { | |
| snapshot: subscription.snapshot, | |
| activate: () => subscription.activate(), | |
| close: () => subscription.close(), | |
| }; | |
| }, | |
| }; | |
| } | |