Flow.Launcher/Flow.Launcher.Plugin/Interfaces/IHomeQuery.cs

29 lines
931 B
C#
Raw Permalink Normal View History

2025-03-29 14:03:30 +00:00
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Flow.Launcher.Plugin
{
/// <summary>
/// Synchronous Query Model for Flow Launcher When Query Text is Empty
/// <para>
/// If the Querying method requires high IO transmission
/// or performing CPU intense jobs (performing better with cancellation), please try the IAsyncHomeQuery interface
2025-03-29 14:03:30 +00:00
/// </para>
/// </summary>
2025-05-03 00:58:40 +00:00
public interface IHomeQuery : IAsyncHomeQuery
2025-03-29 14:03:30 +00:00
{
/// <summary>
/// Querying When Query Text is Empty
/// <para>
/// This method will be called within a Task.Run,
/// so please avoid synchronously wait for long.
2025-03-29 14:03:30 +00:00
/// </para>
/// </summary>
/// <returns></returns>
2025-05-03 00:58:40 +00:00
List<Result> HomeQuery();
2025-03-29 14:03:30 +00:00
2025-05-03 00:58:40 +00:00
Task<List<Result>> IAsyncHomeQuery.HomeQueryAsync(CancellationToken token) => Task.Run(HomeQuery);
2025-03-29 14:03:30 +00:00
}
}