IRuntime Interface

Packages > @fluidframework/container-definitions > IRuntime

The IRuntime represents an instantiation of a code package within a Container. Primarily held by the ContainerContext to be able to interact with the running instance of the Container.

Signature:

export interface IRuntime extends IDisposable 

Extends: IDisposable

Methods

List of methods of this class
Method Description
createSummary()
getPendingLocalState() Get pending local state in a serializable format to be given back to a newly loaded container
process(message, local, context) Processes the given op (message)
processSignal(message, local) Processes the given signal
request(request) Executes a request against the runtime
setAttachState(attachState) Propagate the container state when container is attaching or attached.
setConnectionState(connected, clientId) Notifies the runtime of a change in the connection state
snapshot(tagMessage, fullTree) Snapshots the runtime
stop()

Methods

createSummary

Signature:

createSummary(): ISummaryTree;

Returns:

ISummaryTree

getPendingLocalState

Get pending local state in a serializable format to be given back to a newly loaded container

Signature:

getPendingLocalState(): unknown;

Returns:

unknown

process

Processes the given op (message)

Signature:

process(message: ISequencedDocumentMessage, local: boolean, context: any): any;

Parameters

List of parameters
Parameter Type Description
message ISequencedDocumentMessage
local boolean
context any

Returns:

any

processSignal

Processes the given signal

Signature:

processSignal(message: any, local: boolean): any;

Parameters

List of parameters
Parameter Type Description
message any
local boolean

Returns:

any

request

Executes a request against the runtime

Signature:

request(request: IRequest): Promise<IResponse>;

Parameters

List of parameters
Parameter Type Description
request IRequest

Returns:

Promise<IResponse>

setAttachState

Propagate the container state when container is attaching or attached.

Signature:

setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;

Parameters

List of parameters
Parameter Type Description
attachState AttachState.Attaching | AttachState.Attached State of the container.

Returns:

void

setConnectionState

Notifies the runtime of a change in the connection state

Signature:

setConnectionState(connected: boolean, clientId?: string): any;

Parameters

List of parameters
Parameter Type Description
connected boolean
clientId string

Returns:

any

snapshot

Snapshots the runtime

Signature:

snapshot(tagMessage: string, fullTree?: boolean): Promise<ITree | null>;

Parameters

List of parameters
Parameter Type Description
tagMessage string
fullTree boolean

Returns:

Promise<ITree | null>

stop

Warning: This API is now obsolete.

in 0.14 async stop() Use snapshot to get a snapshot for an IRuntimeState as needed, followed by dispose

Stops the runtime. Once stopped no more messages will be delivered and the context passed to the runtime on creation will no longer be active

Signature:

stop(): Promise<{
        snapshot?: never;
        state?: never;
    }>;

Returns:

Promise<{ snapshot?: never; state?: never; }>