KetraTerm
API · v0.3.0All versions

TerminalBoundedDirectoryScanner

class TerminalBoundedDirectoryScanner @JvmOverloads constructor(maxVisitedEntries: Int = DEFAULT_MAX_VISITED_ENTRIES, scanBudgetNanos: Long = TimeUnit.MILLISECONDS.toNanos(DEFAULT_SCAN_BUDGET_MILLIS), nanoTime: () -> Long = System::nanoTime, ioDispatcher: CoroutineDispatcher = Dispatchers.IO) : TerminalDirectoryScanner

Time- and visit-bounded local directory scanner.

Parameters

maxVisitedEntries

positive cap on inspected direct children.

scanBudgetNanos

positive best-effort monotonic scan budget.

nanoTime

monotonic clock used to enforce the budget.

ioDispatcher

dispatcher used only for blocking filesystem access.

Throws

if a capacity or the scan budget is not positive.

Constructors

Link copied to clipboard
constructor(maxVisitedEntries: Int = DEFAULT_MAX_VISITED_ENTRIES, scanBudgetNanos: Long = TimeUnit.MILLISECONDS.toNanos(DEFAULT_SCAN_BUDGET_MILLIS), nanoTime: () -> Long = System::nanoTime, ioDispatcher: CoroutineDispatcher = Dispatchers.IO)

Functions

Link copied to clipboard
open suspend override fun scan(directory: Path, entryNamePrefix: String): List<TerminalFileEntry>

Returns a bounded deterministic snapshot.