Restructure solution layout by module
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using StellaOps.Concelier.Core.Jobs;
|
||||
|
||||
namespace StellaOps.Concelier.Connector.Jvn;
|
||||
|
||||
internal static class JvnJobKinds
|
||||
{
|
||||
public const string Fetch = "source:jvn:fetch";
|
||||
public const string Parse = "source:jvn:parse";
|
||||
public const string Map = "source:jvn:map";
|
||||
}
|
||||
|
||||
internal sealed class JvnFetchJob : IJob
|
||||
{
|
||||
private readonly JvnConnector _connector;
|
||||
|
||||
public JvnFetchJob(JvnConnector connector)
|
||||
=> _connector = connector ?? throw new ArgumentNullException(nameof(connector));
|
||||
|
||||
public Task ExecuteAsync(JobExecutionContext context, CancellationToken cancellationToken)
|
||||
=> _connector.FetchAsync(context.Services, cancellationToken);
|
||||
}
|
||||
|
||||
internal sealed class JvnParseJob : IJob
|
||||
{
|
||||
private readonly JvnConnector _connector;
|
||||
|
||||
public JvnParseJob(JvnConnector connector)
|
||||
=> _connector = connector ?? throw new ArgumentNullException(nameof(connector));
|
||||
|
||||
public Task ExecuteAsync(JobExecutionContext context, CancellationToken cancellationToken)
|
||||
=> _connector.ParseAsync(context.Services, cancellationToken);
|
||||
}
|
||||
|
||||
internal sealed class JvnMapJob : IJob
|
||||
{
|
||||
private readonly JvnConnector _connector;
|
||||
|
||||
public JvnMapJob(JvnConnector connector)
|
||||
=> _connector = connector ?? throw new ArgumentNullException(nameof(connector));
|
||||
|
||||
public Task ExecuteAsync(JobExecutionContext context, CancellationToken cancellationToken)
|
||||
=> _connector.MapAsync(context.Services, cancellationToken);
|
||||
}
|
||||
Reference in New Issue
Block a user