I have a problem dealing with the [Queue] attribute.
public interface IJob
{
string Name { get; set; }
string Parameter { get; set; }
void Execute(IJobCancellationToken cancellationToken, string parameter);
}
Now I have different classes which implement these Interface.
Sample.
Next I have a JobSchedulerClient with the Interface:
public interface IJobClient
{
void Enqueue(Expression<Action> expression);
void AddOrUpdateRecurring(string name, Expression<Action> expression, string cronExpression, TimeZoneInfo timeZone = null);
}
Implementation:
public void Enqueue(Expression<Action> expression)
{
BackgroundJob.Enqueue(expression);
}
Where should I set the [Queue] Attribute.
I believe a “Queue” Parameter would be more handle.
When I do this in the Job Implementation:
[Queue(“export”)]
public void Execute(IJobCancellationToken cancellationToken, string parameter)
the Queue is still “default”.