Table of Contents

Interface IReporter

Namespace
Fabricator.Core
Assembly
Fabricator.Core.dll

Reports the status, progress, and log of the resource check or application it is passed to.

[Interface]
[CompilationMapping(SourceConstructFlags.ObjectType)]
public interface IReporter

Remarks

All the members are thread-safe.

Methods

Log(string)

Writes a line to the log of the resource check or application. The log lines of different operations are never interleaved with each other: while some other operation's log is being shown, the lines are buffered.

void Log(string message)

Parameters

message string

Status(string)

Sets a short status message describing what the resource check or application is currently doing. The status is only shown while the operation is running, and is not logged.

void Status(string newStatus)

Parameters

newStatus string

WithProgress<a>(string, FSharpOption<long>?, ProgressUnit, FSharpFunc<IProgressReporter, FSharpAsync<a>>)

Runs the action, showing the progress it reports.

FSharpAsync<a> WithProgress<a>(string header, FSharpOption<long>? total, ProgressUnit progressUnit, FSharpFunc<IProgressReporter, FSharpAsync<a>> action)

Parameters

header string

The status shown while the action is running.

total FSharpOption<long>

The total amount of work, or None if unknown.

progressUnit ProgressUnit

The unit of the reported values.

action FSharpFunc<IProgressReporter, FSharpAsync<a>>

The action, receiving the reporter of its progress.

Returns

FSharpAsync<a>

Type Parameters

a

Remarks

The progress is shown as a part of the operation that has received this reporter. It is reset after the action finishes. If several such actions run concurrently within the same operation, the progress of the latest started one that is still running is shown.