mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-26 05:02:50 +08:00
23 lines
767 B
C#
23 lines
767 B
C#
namespace Spectre.Console;
|
|
|
|
/// <summary>
|
|
/// Represents an exclusivity mode.
|
|
/// </summary>
|
|
public interface IExclusivityMode
|
|
{
|
|
/// <summary>
|
|
/// Runs the specified function in exclusive mode.
|
|
/// </summary>
|
|
/// <typeparam name="T">The result type.</typeparam>
|
|
/// <param name="func">The func to run in exclusive mode.</param>
|
|
/// <returns>The result of the function.</returns>
|
|
T Run<T>(Func<T> func);
|
|
|
|
/// <summary>
|
|
/// Runs the specified function in exclusive mode asynchronously.
|
|
/// </summary>
|
|
/// <typeparam name="T">The result type.</typeparam>
|
|
/// <param name="func">The func to run in exclusive mode.</param>
|
|
/// <returns>The result of the function.</returns>
|
|
Task<T> RunAsync<T>(Func<Task<T>> func);
|
|
} |