// Copyright (c) Microsoft. All rights reserved. using System; using System.Threading.Channels; using System.Threading.Tasks; using Microsoft.Agents.AI.Purview.Models.Jobs; namespace Microsoft.Agents.AI.Purview; /// /// Interface for a class that controls background job processing. /// internal interface IChannelHandler { /// /// Queue a job for background processing. /// /// The job queued for background processing. void QueueJob(BackgroundJobBase job); /// /// Add a runner to the channel handler. /// /// The runner task used to process jobs. void AddRunner(Func, Task> runnerTask); /// /// Stop the channel and wait for all runners to complete /// /// A task representing the job. Task StopAndWaitForCompletionAsync(); }