Last active
January 2, 2016 10:49
-
-
Save agilejon/8292891 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class BifrostCommand<TArgs, TResult> : Command<TResult> | |
{ | |
private readonly TArgs _arguments; | |
private readonly string _path; | |
public BifrostCommand(GroupKey isolationKey, TArgs arguments, string servicePath) | |
: base(isolationKey, TimeSpan.FromMilliseconds(15000)) // TODO make a constant available? | |
{ | |
_arguments = arguments; | |
_path = servicePath; | |
} | |
protected async Task<TResult> ExecuteAsync(CancellationToken cancellationToken) | |
{ | |
return await BifrostServiceContext.SendAsync<TArgs, TResult>(_path, _arguments, cancellationToken); | |
} | |
} | |
public class GetRecruitTeamCommand : BifrostCommand<string, RecruitTeamDto> | |
{ | |
public GetRecruitTeamCommand(string args) | |
: base(GroupKey.Named("recruit"), args, RecruitCommands.GetRecruitTeam) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment