MCPcopy Create free account
hub / github.com/cloudflare/computer / #runWithInvalidation

Method #runWithInvalidation

packages/computer/src/workspace.ts:695–708  ·  view source on GitHub ↗
(
    id: string,
    handle: BackendHandle,
    op: () => Promise<T>,
  )

Source from the content-addressed store, hash-verified

693 // the cached handle before the error rethrows. Non-transport
694 // errors pass through untouched.
695 async #runWithInvalidation<T>(
696 id: string,
697 handle: BackendHandle,
698 op: () => Promise<T>,
699 ): Promise<T> {
700 try {
701 return await op();
702 } catch (error) {
703 if (isWorkspaceTransportFailure(error)) {
704 this.#invalidateHandle(id, handle);
705 }
706 throw error;
707 }
708 }
709
710 // Per-backend mutation FIFO. Public push() / pull() calls and each
711 // command's pre-exec push and post-stream pull route through this;

Callers 2

pushMethod · 0.95
#pullResolvedMethod · 0.95

Calls 3

#invalidateHandleMethod · 0.95
opFunction · 0.85

Tested by

no test coverage detected