Add client interaction and Fable support

This commit is contained in:
Smaug123
2022-10-29 10:44:02 +01:00
parent a4e1a2dbdc
commit c3f411cdda
4 changed files with 77 additions and 13 deletions

View File

@@ -32,7 +32,11 @@ type InMemoryPersistentState<'a> () =
member this.CurrentTerm = currentTerm * 1<Term>
member this.IncrementTerm () =
#if FABLE_COMPILER
currentTerm <- currentTerm + 1
#else
Interlocked.Increment &currentTerm |> ignore
#endif
member this.VotedFor = votedFor
member this.Vote id = votedFor <- Some id