-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathIOutputCoordinator.cs
More file actions
30 lines (27 loc) · 1.23 KB
/
Copy pathIOutputCoordinator.cs
File metadata and controls
30 lines (27 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
namespace ModularPipelines.Console;
/// <summary>
/// Coordinates immediate flushing of module output with synchronization.
/// Ensures modules write output in FIFO completion order without interleaving.
/// </summary>
internal interface IOutputCoordinator
{
/// <summary>
/// Gets whether output flushing is currently in progress.
/// When true, console writes should bypass buffering and go directly to the real console.
/// </summary>
bool IsFlushing { get; }
/// <summary>
/// Sets the progress controller for pause/resume coordination.
/// Must be called before any modules complete.
/// </summary>
/// <param name="controller">The progress controller.</param>
void SetProgressController(IProgressController controller);
/// <summary>
/// Enqueues a module's buffer for immediate flushing and waits until flushed.
/// Called when a module's logger is disposed.
/// </summary>
/// <param name="buffer">The buffer to flush.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>A task that completes when the buffer has been flushed.</returns>
Task EnqueueAndFlushAsync(IModuleOutputBuffer buffer, CancellationToken cancellationToken = default);
}