mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-28 15:12:51 +08:00
26 lines
747 B
C#
26 lines
747 B
C#
namespace Ocelot.Provider.Rafty
|
|
{
|
|
using Configuration.Setter;
|
|
using global::Rafty.FiniteStateMachine;
|
|
using global::Rafty.Log;
|
|
using System.Threading.Tasks;
|
|
|
|
public class OcelotFiniteStateMachine : IFiniteStateMachine
|
|
{
|
|
private readonly IFileConfigurationSetter _setter;
|
|
|
|
public OcelotFiniteStateMachine(IFileConfigurationSetter setter)
|
|
{
|
|
_setter = setter;
|
|
}
|
|
|
|
public async Task Handle(LogEntry log)
|
|
{
|
|
//todo - handle an error
|
|
//hack it to just cast as at the moment we know this is the only command :P
|
|
var hack = (UpdateFileConfiguration)log.CommandData;
|
|
await _setter.Set(hack.Configuration);
|
|
}
|
|
}
|
|
}
|