Skip to content

System Calls

For Information Only

This section documents the internal system call interfaces used by ActualLab.Rpc and Fusion. You should never send these calls manually – they are automatically invoked by the framework to manage RPC communication, call lifecycle, streaming, and computed value invalidation.

Understanding these calls may be helpful for debugging, extending the framework, or understanding the wire protocol.

IRpcSystemCalls

IRpcSystemCalls is the core system service interface (service name: $sys) that handles RPC infrastructure operations. All methods use fire-and-forget semantics via RpcNoWait where appropriate.

Handshake & Reconnection

MethodArgumentsDescription
HandshakeRpcHandshake handshakeInitiates connection handshake between peers
Reconnectint handshakeIndex, Dictionary<int, byte[]> completedStagesData, CancellationTokenHandles reconnection after network interruption

Call Lifecycle

MethodArgumentsDescription
Okobject? resultReturns successful call result to the caller
ErrorExceptionInfo errorReturns error information to the caller
Cancel(none)Cancels an in-progress call
M(none)Signals a "match" (cache hit) for Compute Service calls
NotFoundstring serviceName, string methodNameIndicates the requested service/method doesn't exist

Object Lifecycle

MethodArgumentsDescription
KeepAlivelong[] localIdsKeeps remote objects alive (prevents garbage collection)
Disconnectlong[] localIdsDisconnects/releases remote objects

Stream Control

MethodArgumentsDescription
Acklong nextIndex, Guid hostIdAcknowledges received stream items (flow control)
AckEndGuid hostIdAcknowledges stream completion
Ilong index, object? itemSends a single stream item
Blong index, object? itemsSends a batch of stream items
Endlong index, ExceptionInfo errorSignals stream completion (with optional error)

IRpcComputeSystemCalls

IRpcComputeSystemCalls is a Fusion-specific system service interface (service name: $sys-c) that handles computed value invalidation propagation.

MethodArgumentsDescription
Invalidate(none)Notifies the client that a computed value has been invalidated on the server

This single call is the mechanism that enables real-time UI updates in Fusion. When a server-side Computed<T> is invalidated, the server sends an Invalidate call to all connected clients that have replicas of that computed value. This triggers re-computation on the client side, which in turn updates any dependent UI components.