Function
makeBackend
(
id: string,
rpc?: import("@cloudflare/computer-rpc").SyncRPC,
)
Source from the content-addressed store, hash-verified
| 133 | } |
| 134 | |
| 135 | function makeBackend( |
| 136 | id: string, |
| 137 | rpc?: import("@cloudflare/computer-rpc").SyncRPC, |
| 138 | ): WorkspaceBackend { |
| 139 | return { |
| 140 | id, |
| 141 | type: "fake", |
| 142 | async connect(): Promise<BackendHandle> { |
| 143 | return { rpc: composite(rpc ?? fakeRpc()), close: async () => {} }; |
| 144 | }, |
| 145 | }; |
| 146 | } |
| 147 | |
| 148 | // Backend with a wired shell.exec that pings a counter on every |
| 149 | // call. exec resolves immediately with an empty event stream so |
Tested by
no test coverage detected