Table of Contents

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

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<SwapMemoryInfo>

A task whose result is the swap memory's sizes.

Exceptions

OperationCanceledException

cancellationToken was 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

size long

The size, in bytes; 0 for none.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task

A task that completes once the provider is done.

Exceptions

OperationCanceledException

cancellationToken was canceled.