Table of Contents

Class ServerCommand<TArgs>

Namespace
RDCore.SDK.Server.Commands
Assembly
RDCore.SDK.dll

Represents any server command that a RDCore server application can receive, or that a RDCore client application can send.

public abstract class ServerCommand<TArgs> : ServerCommand where TArgs : class, new()

Type Parameters

TArgs
Inheritance
ServerCommand<TArgs>
Inherited Members

Remarks

👉 Avoid hard-coding server command names in client-side services.

LSP 3.17 § ExecuteCommand request

Constructors

ServerCommand(ICommandParamsParser<TArgs>, string)

Represents any server command that a RDCore server application can receive, or that a RDCore client application can send.

protected ServerCommand(ICommandParamsParser<TArgs> CommandArgsParser, string name)

Parameters

CommandArgsParser ICommandParamsParser<TArgs>
name string

The name of the underlying protocol-level (LSP) workspace command request.

Remarks

👉 Avoid hard-coding server command names in client-side services.

LSP 3.17 § ExecuteCommand request

Methods

ExecuteAsync(CancellationToken, JArray?)

Asynchronously enqueues the execution of a command on the server.

public override sealed Task ExecuteAsync(CancellationToken token, JArray? args = null)

Parameters

token CancellationToken

A CancellationToken, for cooperative asynchronous task cancellation.

args JArray

The deserialized raw command parameter object.

Returns

Task

ExecuteAsync(TArgs?, CancellationToken)

Executes the command asynchronously on the server.

protected abstract Task ExecuteAsync(TArgs? args, CancellationToken token)

Parameters

args TArgs

The deserialized raw command parameter object.

token CancellationToken

A CancellationToken, for cooperative asynchronous task cancellation.

Returns

Task