Skip to content

MessageTarget

Defined in: packages/core/src/message/target.ts:55

What a platform target must provide to the shared message lifecycle.

Message

Snapshot

readonly optional pause?: () => void

Defined in: packages/core/src/message/target.ts:70

Stops draining queued snapshots until resume.

void


readonly ready: Effect<Message, MessageTargetError>

Defined in: packages/core/src/message/target.ts:57

The first platform message, once it has been created.


readonly optional resume?: () => void

Defined in: packages/core/src/message/target.ts:72

Resumes draining the newest queued snapshot.

void


readonly run: Effect<never>

Defined in: packages/core/src/message/target.ts:62

Drains queued snapshots while the target is open. The effect stays alive after close() so the owning mount scope controls when it ends.

close(): void

Defined in: packages/core/src/message/target.ts:68

Stops future sends and fails ready if no message was created yet.

void


fail(error): void

Defined in: packages/core/src/message/target.ts:66

Fails the in-flight attempt when the host cannot produce a snapshot.

MessageTargetError

void


queue(snapshot): void

Defined in: packages/core/src/message/target.ts:64

Enqueues the newest snapshot. Safe to call from a host commit.

Snapshot

void