SyncMuseClient
The blocking twin of MuseClient for plain scripts; async contexts — Jupyter cells included, since a cell already runs inside a live loop — use MuseClient directly.
Class in muse_code
Get one from spawn (an owned host) or create (a client you
compose yourself); every verb then blocks the calling thread while the
private loop runs the async facade. Call close to shut the host
down and release the loop.
Constructor
Section titled “Constructor”SyncMuseClient(client: MuseClient[_I], loop: asyncio.AbstractEventLoop)
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
initialize_result |
InitializeResult |
The handshake result, when built by spawn (no loop needed). |
durability |
SessionDurabilityProfile |
The durability profile every session this client opens inherits. |
Methods
Section titled “Methods”| Method | Signature | Description |
|---|---|---|
spawn |
spawn(options: MuseClientSpawnOptions) -> 'SyncMuseClient[Any]' |
Spawn an owned host and hand back a blocking client — the sync twin of spawn. |
create |
create(factory: Callable[[], Awaitable[MuseClient[_I]]]) -> 'SyncMuseClient[_I]' |
Build a blocking client around an async client you compose yourself — the sync twin of the MuseClient constructor. |
start_session |
start_session(options: StartSessionOptions | None = None) -> 'SyncSession[_I]' |
Open a new root session (blocking twin of start_session). |
resume_session |
resume_session(options: ResumeSessionOptions) -> 'SyncSession[_I]' |
Load an existing session (blocking twin of resume_session). |
wait_exit |
wait_exit() -> ExitClassification |
Block until the owned host exits; its row (twin of exit). |
close |
close() -> None |
Shut the host down, then retire the private loop. |
Source
clients/sdk-py/src/muse_code/sync_facade.py:195