@@ -8,7 +8,6 @@ import zio.raft.{Command, Index, MemberId, Raft, SnapshotStore, StateMachine}
88import zio .stream .{Stream , ZStream }
99import zio .zmq .ZContext
1010import zio .{Chunk , UIO , ZIO , ZIOAppArgs , ZLayer }
11- import zio .prelude .State
1211
1312import scodec .Codec
1413import scodec .bits .BitVector
@@ -56,8 +55,8 @@ class KVStateMachine extends StateMachine[Any, Map[String, String], KVCommand]:
5655 override def apply (command : KVCommand )
5756 : ZPure [Any , Map [String , String ], Map [String , String ], Any , Nothing , command.Response ] =
5857 (command match
59- case Set (k, v) => State .update((map : Map [String , String ]) => map.updated(k, v))
60- case Get (k) => State .get.map((map : Map [String , String ]) => map.get(k).getOrElse(" " ))
58+ case Set (k, v) => ZPure .update((map : Map [String , String ]) => map.updated(k, v))
59+ case Get (k) => ZPure .get.map((map : Map [String , String ]) => map.get(k).getOrElse(" " ))
6160 ).map(_.asInstanceOf [command.Response ])
6261
6362class HttpServer (raft : Raft [Any , Map [String , String ], KVCommand ]):
0 commit comments