GatewayHandoffOrchestrator class
Orchestrator that owns the gateway-handoff state machine
for one MobileReaderSdk instance.
The orchestrator does not wire itself into the
platform-channel adapter in this branch; the integration
branch that flips a MobileReaderSdk to drive the handoff
on encryptedPayloadReady will instantiate it and route
events. Here we ship:
- the
GatewayConfig+GatewayClientplumbing, - the
handoff(...)method that turns a normalizedGatewayTransactionRequestinto a sequence ofGatewayHandoffEvents, - a broadcast stream the integration layer reads to
merge handoff events into the unified
ReaderEventstream.
Concurrency. Only one handoff can be in flight at a
time. A second concurrent call resolves immediately as a
failed(internalError) event so the integration layer
surfaces it on the stream without ever talking to the
gateway.
Cancellation. dispose() closes the client and
completes any pending stream subscriber. The orchestrator
does NOT try to cancel a half-sent network call — gateways
may have already received the request, and the SDK MUST
NOT make assumptions about idempotency on the wire.
Constructors
- GatewayHandoffOrchestrator({required GatewayConfig config, GatewayClientFactory clientFactory = const DefaultGatewayClientFactory(), required GatewayTransport transport})
Properties
- config → GatewayConfig
-
final
-
events
→ Stream<
GatewayHandoffEvent> -
Broadcast stream of
started/completed/failedevents for every handoff the orchestrator runs.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isHandoffMode → bool
-
Whether the orchestrator is configured to actually call
out to a gateway.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → Future< void> -
Release any resources the orchestrator holds. After
dispose()the orchestrator rejects furtherhandoffcalls. -
handoff(
GatewayTransactionRequest request) → Future< GatewayHandoffResponse> -
Begin a handoff for
request. The returnedFutureresolves with the gateway response or throws a GatewayError; subscribers can also observe progress via events. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited