Class ServerCommand<TArgs>
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
CommandArgsParserICommandParamsParser<TArgs>namestringThe
nameof 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
tokenCancellationTokenA CancellationToken, for cooperative asynchronous task cancellation.
argsJArrayThe deserialized raw command parameter object.
Returns
ExecuteAsync(TArgs?, CancellationToken)
Executes the command asynchronously on the server.
protected abstract Task ExecuteAsync(TArgs? args, CancellationToken token)
Parameters
argsTArgsThe deserialized raw command parameter object.
tokenCancellationTokenA CancellationToken, for cooperative asynchronous task cancellation.