Skip to main content

Module migration_handler

Module migration_handler 

Source
Expand description

Migration subprotocol message handler.

Dispatches inbound migration messages (subprotocol 0x0500) to the appropriate handler: orchestrator, source, or target.

Structs§

MigrationHandlerHooks
Optional cross-cutting hooks consumed by MigrationSubprotocolHandler::with_hooks. Each field is independently opt-in so a test that cares about one hook doesn’t have to fabricate the others; Default = nothing wired.
MigrationIdentityContext
Identity-transport context for automatic envelope seal/open in the migration dispatcher.
MigrationSubprotocolHandler
Dispatcher for migration subprotocol (0x0500) messages.
OutboundMigrationMessage
Outbound message with destination node.

Type Aliases§

EnvelopeUnsealFn
Callback that opens an identity envelope carried on a crate::adapter::net::state::snapshot::StateSnapshot, using a local private key captured inside the closure. See MigrationIdentityContext for key-hygiene rationale.
FailureCallback
Callback fired on the source side whenever the dispatcher observes an inbound MigrationFailed message. The SDK uses this to surface the structured reason code to the MigrationHandle::wait caller so they can distinguish retriable from terminal failures.
PostRestoreCallback
Handles inbound migration subprotocol messages.
PreCleanupCallback
Callback fired on the source side at CutoverNotify handling, immediately before source_handler.cleanup unregisters the daemon. Stage 4 of DAEMON_CHANNEL_REBIND_PLAN.md: the SDK’s hook snapshots the daemon’s subscription ledger here and spawns async unsubscribe_channel calls to each publisher so rosters drop the source immediately rather than aging out over the session-timeout window.
ReadinessCallback
Readiness predicate — returns true when the local runtime is prepared to accept inbound migrations (target path). When populated and the predicate returns false, the dispatcher responds to SnapshotReady with MigrationFailureReason::NotReady so the source can retry with backoff rather than surfacing a terminal error while the target is still booting.