PatchbayServiceHost class final
Generic VM Service extension host. It has no Flutter or consumer imports.
domainGates is the evaluator consumer-owned write commands cross before
they reach invoke. A command is admitted through it when the registry does
not serve it and its catalog row does not declare sideEffect: none; the
row's gates are handed to the evaluator unchanged, so an empty set still
runs the non-optional base gate. Leaving it null keeps gate-free commands
exactly as they were, but a row that declares gates no evaluator can run is
then refused rather than silently admitted.
Constructors
-
PatchbayServiceHost({required String applicationId, required PatchbayCatalogSource catalog, PatchbaySnapshotSource? snapshot, PatchbayVersionedSnapshotSource? versionedSnapshot, PatchbaySnapshotRetentionLimits snapshotRetention = PatchbaySnapshotRetentionLimits.production, PatchbayInvocationSource? invoke, PatchbayContextInvocationSource? invokeWithContext, PatchbayCommandRegistry? registry, String? appInstanceId, PatchbayExtensionRegistrar? registrar, Set<
PatchbayFeature> features = const <PatchbayFeature>{}, PatchbayGateEvaluator? domainGates, PatchbayAuditSink? auditSink, PatchbayAuditSinkErrorHandler? onAuditSinkError, int auditQueueCapacity = 256, int maxConcurrentInvocations = 8, Duration cancellationConfirmationTimeout = const Duration(seconds: 2), PatchbayMonotonicClock? monotonicClock}) -
factory
-
PatchbayServiceHost.withCatalogProvider({required String applicationId, required PatchbayCatalogProvider catalogProvider, PatchbaySnapshotSource? snapshot, PatchbayVersionedSnapshotSource? versionedSnapshot, PatchbaySnapshotRetentionLimits snapshotRetention = PatchbaySnapshotRetentionLimits.production, PatchbayInvocationSource? invoke, PatchbayContextInvocationSource? invokeWithContext, PatchbayCommandRegistry? registry, String? appInstanceId, PatchbayExtensionRegistrar? registrar, Set<
PatchbayFeature> features = const <PatchbayFeature>{}, PatchbayGateEvaluator? domainGates, PatchbayAuditSink? auditSink, PatchbayAuditSinkErrorHandler? onAuditSinkError, int auditQueueCapacity = 256, int maxConcurrentInvocations = 8, Duration cancellationConfirmationTimeout = const Duration(seconds: 2), PatchbayMonotonicClock? monotonicClock}) -
factory
Properties
- appInstanceId → String
-
final
- applicationId → String
-
final
-
auditEvents
→ List<
PatchbayAuditEvent> -
The newest 256 redacted command facts, in dispatch completion order.
no setter
- auditQueueCapacity → int
-
final
- auditSink → PatchbayAuditSink?
-
final
-
features
→ Set<
PatchbayFeature> -
Capabilities this host declares on the identity plane.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- onAuditSinkError → PatchbayAuditSinkErrorHandler?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancelInvocation(
{required String command, required String requestId, required String ownerToken, PatchbayInvocationCancellationReason reason = PatchbayInvocationCancellationReason.explicitRequest}) → Future< PatchbayInvocationCancellationResult> -
dispatchCatalog(
) → Future< Map< String, Object?> > - Transport-neutral dispatch seam used by alternate, explicitly enabled hosts.
-
dispatchInvoke(
String command, Map< String, Object?> arguments, String requestId, {String? ownerToken, Duration? deadline}) → Future<Map< String, Object?> > - Dispatches an invocation through the registry or external invocation handler.
-
dispatchInvokeHandle(
String command, Map< String, Object?> arguments, String requestId, {String? ownerToken, Duration? deadline}) → PatchbayHostInvocationHandle -
dispatchSnapshot(
[Map< String, Object?> ? request]) → Future<Map< String, Object?> > - Serves the snapshot RPC: the whole snapshot, one selected field, or a server-side wait for a condition on that field.
-
dispose(
{Duration invocationTimeout = const Duration(seconds: 2), Duration auditTimeout = const Duration(seconds: 2)}) → Future< void> - Drains host-owned resources. Repeated calls return the same future.
-
drainAudit(
{Duration timeout = const Duration(seconds: 2)}) → Future< PatchbayAuditDrainResult> - Stops accepting audit deliveries and waits for the accepted prefix.
-
drainInvocations(
{Duration timeout = const Duration(seconds: 2)}) → Future< PatchbayInvocationDrainResult> -
handleCancelInvocation(
String method, Map< String, String> parameters) → Future<ServiceExtensionResponse> -
handleCatalog(
String method, Map< String, String> parameters) → Future<ServiceExtensionResponse> -
handleIdentity(
String method, Map< String, String> parameters) → Future<ServiceExtensionResponse> -
handleInvoke(
String method, Map< String, String> parameters) → Future<ServiceExtensionResponse> -
handleSnapshot(
String method, Map< String, String> parameters) → Future<ServiceExtensionResponse> -
identityResponse(
) → Map< String, Object?> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- commandNamePattern → RegExp
-
no setter
Constants
- cancelInvocationMethod → const String
- catalogMethod → const String
- identityMethod → const String
- invokeMethod → const String
- schemaVersion → const int
- snapshotMethod → const String
- snapshotRequestKey → const String
- stdinProvenanceKey → const String