mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
b19860b8a8
* Move Purview integration logic into middleware * Improve error handling and user id management * Rename purview package * Handle 402s more explicitly; add Middleware generation methods; don't ignore exceptions * Use DI container; pass scope id to PC * Add protection scope caching * Wrap more exceptions in PurviewClient * Remove block check dedup; add tests * Refactor PurviewWrapper intialization; Add unit tests * Use different .Use method and add IDisposable stub * Add background job processing for Purview * Misc comment cleanup * Apply copilot comments * Fix formatting * Formatting other files to fix pipeline * Small updates to settings and exceptions * Add README * Move Purview sample * Address review comments and update XML comments * Newline after namespace * Move public Purview classes to single namespace; Clean up csproj and slnx * Commit the renames * Remove unused openAI dependency --------- Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
33 lines
986 B
C#
33 lines
986 B
C#
// 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;
|
|
|
|
/// <summary>
|
|
/// Interface for a class that controls background job processing.
|
|
/// </summary>
|
|
internal interface IChannelHandler
|
|
{
|
|
/// <summary>
|
|
/// Queue a job for background processing.
|
|
/// </summary>
|
|
/// <param name="job">The job queued for background processing.</param>
|
|
void QueueJob(BackgroundJobBase job);
|
|
|
|
/// <summary>
|
|
/// Add a runner to the channel handler.
|
|
/// </summary>
|
|
/// <param name="runnerTask">The runner task used to process jobs.</param>
|
|
void AddRunner(Func<Channel<BackgroundJobBase>, Task> runnerTask);
|
|
|
|
/// <summary>
|
|
/// Stop the channel and wait for all runners to complete
|
|
/// </summary>
|
|
/// <returns>A task representing the job.</returns>
|
|
Task StopAndWaitForCompletionAsync();
|
|
}
|