Interface ISwapMemoryProvider
- Namespace
- VpnHood.Core.Server.Abstractions
- Assembly
- VpnHood.Core.Server.dll
Represents what manages the server machine's swap memory: the machine's own, and the swap file the server adds, as its configuration asks.
public interface ISwapMemoryProvider
Methods
GetInfo(CancellationToken)
Gets the machine's swap memory now.
Task<SwapMemoryInfo> GetInfo(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<SwapMemoryInfo>
A task whose result is the swap memory's sizes.
Exceptions
- OperationCanceledException
cancellationTokenwas canceled.
SetAppSwapMemorySize(long, CancellationToken)
Sets the size of the server's own swap file, which a provider may round, or take as none when small.
Task SetAppSwapMemorySize(long size, CancellationToken cancellationToken)
Parameters
sizelongThe size, in bytes; 0 for none.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that completes once the provider is done.
Exceptions
- OperationCanceledException
cancellationTokenwas canceled.