namespace Insight.Remote.Shared.Abstractions;

public interface IDispatcher
{
    Task<Thread> RunAsync(CancellationToken cancellationToken);
    Task ShutdownAsync();

    ValueTask InvokeAsync(Action action, CancellationToken cancellationToken = default);
    ValueTask<T?> InvokeAsync<T>(Func<T> func, CancellationToken cancellationToken = default);
}