Skip to content

Instantly share code, notes, and snippets.

@agilejon
Last active January 2, 2016 10:49
Show Gist options
  • Save agilejon/8292891 to your computer and use it in GitHub Desktop.
Save agilejon/8292891 to your computer and use it in GitHub Desktop.
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