-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or requestfeatureThis label is in use for minor version incrementsThis label is in use for minor version increments
Milestone
Description
Title: Add deferred and scheduled command execution support
Labels: enhancement, mediator, new-package
Body:
Problem
Some commands need to execute in the future (e.g., send a reminder email in 24 hours, retry a failed payment in 5 minutes). Currently, consumers must implement their own scheduling infrastructure.
Proposed Solution
Create a Cortex.Mediator.Scheduling package:
ICommandSchedulerinterface:
public interface ICommandScheduler
{
Task<string> ScheduleAsync<TCommand>(TCommand command, TimeSpan delay, CancellationToken ct = default)
where TCommand : ICommand;
Task<string> ScheduleAsync<TCommand>(TCommand command, DateTimeOffset executeAt, CancellationToken ct = default)
where TCommand : ICommand;
Task CancelAsync(string scheduleId, CancellationToken ct = default);
}- In-memory implementation for development/testing
- Persistent implementation using a database table
ScheduledCommandProcessor--IHostedServicethat polls and dispatches due commands- Optional integration hooks for Hangfire / Quartz.NET
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestfeatureThis label is in use for minor version incrementsThis label is in use for minor version increments