Skip to content

ReplSessionHandle

Handle for a single live in-memory REPL session.

  • Kind: Class
  • Namespace: Repl.Testing
  • Assembly: Repl.Testing
public sealed class ReplSessionHandle : IAsyncDisposable

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

ValueTask - A task that represents the asynchronous dispose operation.

public SessionSnapshot GetSnapshot()

SessionSnapshot

RunCommandAsync(string, IReadOnlyDictionary<string, string>, CancellationToken)

Section titled “RunCommandAsync(string, IReadOnlyDictionary<string, string>, CancellationToken)”

Runs a command in this session with prefilled answers for interactive prompts.

public ValueTask<CommandExecution> RunCommandAsync(string commandText, IReadOnlyDictionary<string, string> answers, CancellationToken cancellationToken = default)
  • commandText (string): The command text to execute.
  • answers (IReadOnlyDictionary<string, string>): Prompt answers keyed by prompt name. Overrides session-level answers for the same name.
  • cancellationToken (CancellationToken): Cancellation token.

ValueTask<CommandExecution> - The execution result.

RunCommandAsync(string, CancellationToken)

Section titled “RunCommandAsync(string, CancellationToken)”

Runs a command in this session.

public ValueTask<CommandExecution> RunCommandAsync(string commandText, CancellationToken cancellationToken = default)

ValueTask<CommandExecution> - The execution result.

public string SessionId { get; }

string