Skip to content

Commit

Permalink
Added SessionIdResolver to scheduleAsync method
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianKuesters committed Dec 5, 2023
1 parent 989abb3 commit 0e3fc6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/Wemogy.CQRS/Commands/Abstractions/ICommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public interface ICommands
Task<string> ScheduleAsync<TCommand>(TCommand command, TimeSpan delay = default)
where TCommand : ICommandBase;

Task<string> ScheduleAsync<TCommand>(TCommand command, Func<TCommand, string> sessionIdResolver)
where TCommand : ICommandBase;

Task<string> ScheduleAsync<TCommand>(TCommand command, DelayOptions<TCommand> delayOptions)
where TCommand : ICommandBase;

Expand Down
6 changes: 6 additions & 0 deletions src/core/Wemogy.CQRS/Commands/Mediators/CommandsMediator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public Task<string> ScheduleAsync<TCommand>(TCommand command, TimeSpan delay = d
return ScheduleAsync(command, new DelayOptions<TCommand>(delay));
}

public Task<string> ScheduleAsync<TCommand>(TCommand command, Func<TCommand, string> sessionIdResolver)
where TCommand : ICommandBase
{
return ScheduleAsync(command, new DelayOptions<TCommand>(TimeSpan.Zero, sessionIdResolver));
}

public Task<string> ScheduleAsync<TCommand>(TCommand command, DelayOptions<TCommand> delayOptions)
where TCommand : ICommandBase
{
Expand Down

0 comments on commit 0e3fc6f

Please sign in to comment.