DevelopmentDirectoryAssetSource class

Namespace Runic.Assets · Runic.Assets 0.7.0-preview.5

public sealed class DevelopmentDirectoryAssetSource : IAssetSnapshotSource, IAssetSource, IAssetManifestProvider, IAssetSourceChangeNotifier, IDisposable

Inherits or implements IAssetSnapshotSource, IAssetSource, IAssetManifestProvider, IAssetSourceChangeNotifier, IDisposable.

Exposes a refreshable Linux development directory pinned to one no-follow root handle. Every refresh publishes an immutable manifest from that same root identity.

Constructors

DevelopmentDirectoryAssetSource

public DevelopmentDirectoryAssetSource(string rootDirectory, string entryPointRelativePath)

Scans a local development directory and creates its first manifest snapshot.

Properties

Manifest

public AssetManifest Manifest { get; }

Gets the current immutable manifest with identity, digest, and cache metadata.

Documentation from IAssetManifestProvider.Manifest.

SkippedEntries

public IReadOnlyList<string> SkippedEntries { get; }

Gets the directory entries the latest scan skipped because their names are not valid asset paths, such as names containing :, ?, #, a backslash, or a percent-encoded octet.

Methods

Dispose

public void Dispose()

Stops future refreshes and notification admission. Queued notifications are discarded and every external or repeated disposal call waits until callbacks admitted before disposal have finished. Disposal called by the active callback returns without waiting for itself; a later external disposal still waits for that callback. Subscriber exceptions are isolated and never affect a published refresh. Notifications are delivered in refresh order by one dispatcher; handlers may unsubscribe or refresh reentrantly, and changes queued by reentrancy run afterward.

OpenReadAsync

public ValueTask<Stream> OpenReadAsync(string relativePath, CancellationToken cancellationToken = default)

Opens one exact manifest path for reading.

Documentation from IAssetSource.OpenReadAsync.

OpenSnapshotAsync

public ValueTask<AssetReadSnapshot> OpenSnapshotAsync(string relativePath, CancellationToken cancellationToken = default)

Opens one exact manifest asset and its matching immutable descriptor.

Documentation from IAssetSnapshotSource.OpenSnapshotAsync.

Refresh

public AssetManifest Refresh(CancellationToken cancellationToken = default)

Atomically replaces the manifest with a fresh deterministic directory scan.

StartWatching

public IAssetWatch StartWatching(AssetWatchOptions? options = null, CancellationToken cancellationToken = default)

Starts the source's sole debounced filesystem watcher. File changes are coalesced into one refresh after the configured quiet period and successful replacement snapshots publish through DevelopmentDirectoryAssetSource.Changed. Dispose the returned lease or cancel the token to stop it.

ValidateAsync

public ValueTask ValidateAsync(CancellationToken cancellationToken = default)

Validates metadata and backing content.

Documentation from IAssetSource.ValidateAsync.

Events

Changed

public event EventHandler<AssetSourceChangedEventArgs>? Changed

Raised after the source atomically publishes a validated replacement manifest. Publishers invoke handlers outside their refresh lock and isolate subscriber failures.

Documentation from IAssetSourceChangeNotifier.Changed.