Show / Hide Table of Contents

Class DiskSpacePool

Represents a pool of segments of the limited size on the disk.

Inheritance
object
Disposable
DiskSpacePool
Implements
IDisposable
Inherited Members
Disposable.IsDisposed
Disposable.IsDisposing
Disposable.IsDisposingOrDisposed
Disposable.CreateException()
Disposable.DisposedTask
Disposable.GetDisposedTask<T>()
Disposable.TrySetDisposedException<T>(TaskCompletionSource<T>)
Disposable.TrySetDisposedException(TaskCompletionSource)
Disposable.DisposeAsyncCore()
Disposable.DisposeAsync()
Disposable.TryBeginDispose()
Disposable.Dispose()
Disposable.Dispose(IEnumerable<IDisposable>)
Disposable.DisposeAsync(IEnumerable<IAsyncDisposable>)
Disposable.Dispose<T>(ReadOnlySpan<T>)
Disposable.DisposeAsync(params IAsyncDisposable[])
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DotNext.Runtime.Caching
Assembly: DotNext.IO.dll
Syntax
public class DiskSpacePool : Disposable, IDisposable
Remarks

This class can be used to organize on-disk cache in combination with RandomAccessCache. All members of this class are thread-safe.

Constructors

| Edit this page View Source

DiskSpacePool(int, in Options)

Initializes a new pool of segments on the disk in temporary directory.

Declaration
public DiskSpacePool(int maxSegmentSize, in DiskSpacePool.Options options = default)
Parameters
Type Name Description
int maxSegmentSize

The maximum size of the segment to rent, in bytes.

DiskSpacePool.Options options

The configuration options.

Exceptions
Type Condition
ArgumentOutOfRangeException

maxSegmentSize is negative or zero.

| Edit this page View Source

DiskSpacePool(string, int, in Options)

Initializes a new pool of segments on the disk.

Declaration
public DiskSpacePool(string path, int maxSegmentSize, in DiskSpacePool.Options options = default)
Parameters
Type Name Description
string path

The path to the file that is used internally to allocate the disk space.

int maxSegmentSize

The maximum size of the segment to rent, in bytes.

DiskSpacePool.Options options

The configuration options.

Exceptions
Type Condition
ArgumentOutOfRangeException

maxSegmentSize is negative or zero.

Properties

| Edit this page View Source

MaxSegmentSize

Gets the maximum size of the segment to be rented, in bytes.

Declaration
public int MaxSegmentSize { get; }
Property Value
Type Description
int

Methods

| Edit this page View Source

Dispose(bool)

Releases managed and unmanaged resources associated with this object.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

true if called from Dispose(); false if called from finalizer ~Disposable().

Overrides
Disposable.Dispose(bool)
| Edit this page View Source

Rent()

Rents a space on the disk.

Declaration
public DiskSpacePool.Segment Rent()
Returns
Type Description
DiskSpacePool.Segment

The segment within the file.

Implements

IDisposable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾