Skip to main content

Module sync_bridge_shared

Module sync_bridge_shared 

Source
Expand description

Compatibility-only synchronous bridge shim, shared by the outward protocol edges (chio-a2a-edge, chio-acp-edge). The edges gate their use of it on their own compatibility-surface feature; the helper itself is always compiled here so both edges can depend on a single definition instead of textually including this file.

Mirrors the kernel’s sync-bridge gate so the explicit passthrough surface fails closed under a current-thread runtime instead of deadlocking.

Structs§

SyncBridgeIncompatibleWithCurrentThreadRuntime
Sentinel error returned by block_on_tool_server_invoke when the passthrough is invoked from inside a current-thread Tokio runtime. Mirrors chio_kernel::KernelError::SyncBridgeIncompatibleWithCurrentThreadRuntime: polling an async tool-server future with futures::executor::block_on on the only worker thread can deadlock indefinitely if the future awaits Tokio I/O. The kernel bridge refuses this case fail-closed, and the edge shims must match instead of reintroducing the deadlock through the compatibility-surface feature.

Functions§

block_on_tool_server_invoke
Mirrors chio_kernel::kernel::block_on_async_tool_dispatch: on a multi-thread runtime use block_in_place so we yield the runtime; on a current-thread runtime fail-closed with SyncBridgeIncompatibleWithCurrentThreadRuntime instead of silently parking the only worker thread; with no runtime active, drive the future with the non-tokio futures::executor::block_on.