Ocelot/src/Ocelot/Raft/OcelotFiniteStateMachine.cs
Tom Pallister 7cd3ff2ff7
Feature/fix unstable int tests (#376)
* updated packages but build wont work

* #245 implementing more stable rafty

* #245 OK so these raft integration tests are passing everytime on my local mac now...lets see about the build servergit log

* #245 added donation button

* #245 removed file we dont need
2018-05-31 22:08:50 +01:00

27 lines
761 B
C#

using System.Threading.Tasks;
using Ocelot.Configuration.Setter;
using Rafty.FiniteStateMachine;
using Rafty.Log;
namespace Ocelot.Raft
{
[ExcludeFromCoverage]
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);
}
}
}