NCronJob icon indicating copy to clipboard operation
NCronJob copied to clipboard

[V5] Consistent interfaces for typed jobs

Open nulltoken opened this issue 10 months ago • 0 comments

Currently we've got things like this

public void RemoveJob<TJob>() where TJob : IJob => RemoveJob(typeof(TJob));
public void RemoveJob(Type type) => jobWorker.RemoveJobByType(type);

and others than only expose generic based variants

Guid RunScheduledJob<TJob>(TimeSpan delay, object? parameter = null, CancellationToken token = default)
    where TJob : IJob;

The proposal would be to move to Typed based interfaces only and expose Generic based sugar syntax through extension methods delegating to the pure interface methods.

This would have the following benefits

  • Reduce the scope of core interfaces
  • Be able to easily dismiss some lack of code coverage if it only exists at the extension methods level

nulltoken avatar Feb 27 '25 20:02 nulltoken