using System.Threading.Channels;
using Elsa.Jobs.Services;
namespace Elsa.Jobs.Implementations;
///
/// Represents a local, in-memory queue of jobs that will be processed in-process.
///
public class LocalJobQueue : IJobQueue
{
private readonly ChannelWriter _channelWriter;
public LocalJobQueue(ChannelWriter channelWriter)
{
_channelWriter = channelWriter;
}
public async Task SubmitJobAsync(IJob job, string? queueName = default, CancellationToken cancellationToken = default)
{
await _channelWriter.WriteAsync(job, cancellationToken);
}
}