ensureRoutingForSinkDemand method
Registers a callback sink only when it can own live delivery.
Newly-created sessions remain inert until execution is submitted. A restored session must first read native state and is routed only while that state is running. The state read intentionally propagates failures so callers can roll back the sink mutation without leaving a map root.
Implementation
@protected
void ensureRoutingForSinkDemand(void Function() register) {
if (isDisposed) return;
if (hasPendingExecutionRouting) {
register();
return;
}
if (!isRestoredSession) return;
if (executionStateForSubmission() == SessionState.running) {
register();
}
}