2021-01-02 07:52:41 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Flow.Launcher.Plugin
|
|
|
|
|
|
{
|
2021-01-14 04:24:41 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Asynchronous Plugin Model for Flow Launcher
|
|
|
|
|
|
/// </summary>
|
2021-01-02 07:52:41 +00:00
|
|
|
|
public interface IAsyncPlugin
|
|
|
|
|
|
{
|
2021-01-14 04:24:41 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Asynchronous Querying
|
|
|
|
|
|
/// </summary>
|
2021-01-17 07:47:19 +00:00
|
|
|
|
/// <para>
|
|
|
|
|
|
/// If the Querying or Init method requires high IO transmission
|
|
|
|
|
|
/// or performing CPU intense jobs (performing better with cancellation), please use this IAsyncPlugin interface
|
|
|
|
|
|
/// </para>
|
2021-01-14 04:24:41 +00:00
|
|
|
|
/// <param name="query">Query to search</param>
|
|
|
|
|
|
/// <param name="token">Cancel when querying job is obsolete</param>
|
|
|
|
|
|
/// <returns></returns>
|
2021-01-02 07:52:41 +00:00
|
|
|
|
Task<List<Result>> QueryAsync(Query query, CancellationToken token);
|
2021-01-14 04:24:41 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initialize plugin asynchrously (will still wait finish to continue)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="context"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2021-01-02 07:52:41 +00:00
|
|
|
|
Task InitAsync(PluginInitContext context);
|
|
|
|
|
|
}
|
2021-01-17 08:10:26 +00:00
|
|
|
|
}
|