IHistoryProvider
Provides command history storage for interactive sessions.
- Kind:
Interface - Namespace: Repl
- Assembly:
Repl.Core - Source: src/Repl.Core/IHistoryProvider.cs
Signature
Section titled “Signature”public interface IHistoryProviderDerived Classes
Section titled “Derived Classes”Methods
Section titled “Methods”AddAsync(string, CancellationToken)
Section titled “AddAsync(string, CancellationToken)”Persists one interactive command line.
ValueTask AddAsync(string entry, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”entry(string): Raw command line as typed by the user.cancellationToken(CancellationToken): Cancellation token.
Returns
Section titled “Returns”ValueTask - An awaitable operation.
GetRecentAsync(int, CancellationToken)
Section titled “GetRecentAsync(int, CancellationToken)”Reads the most recent history entries.
ValueTask<IReadOnlyList<string>> GetRecentAsync(int maxCount, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”maxCount(int): Maximum number of entries to return.cancellationToken(CancellationToken): Cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyList<string>> - Most recent entries ordered from oldest to newest within the returned window.