doServe :: (RaftLog l e v) => Raft l e v -> Actions e -> IO ()
doServe vRaft actions = do
    raft <- atomically $ readTVar (raftContext vRaft)
    let endpoint = raftEndpoint raft
        leader = raftName raft
    onPerformAction endpoint leader $ \action reply -> do
        atomically $ writeMailbox actions $ Just (action,reply)
    doServe vRaft actions

{-|
Leaders commit entries to their log, once enough members have appended those entries.
Once committed, the leader replies to the client who requested the action.
-}
doServe :: (RaftLog l e v) => Raft l e v -> Actions e -> IO ()
doServe vRaft actions = do
    raft <- atomically $ readTVar (raftContext vRaft)
    let endpoint = raftEndpoint raft
        leader = raftName raft
    onPerformAction endpoint leader $ \action reply -> do
        atomically $ writeMailbox actions $ Just (action,reply)
    doServe vRaft actions

{-|
Leaders commit entries to their log, once enough members have appended those entries.
Once committed, the leader replies to the client who requested the action.
-}
doServe vRaft actions = do
    raft <- atomically $ readTVar (raftContext vRaft)
    let endpoint = raftEndpoint raft
        leader = raftName raft
    onPerformAction endpoint leader $ \action reply -> do
        atomically $ writeMailbox actions $ Just (action,reply)
    doServe vRaft actions

{-|
Leaders commit entries to their log, once enough members have appended those entries.
Once committed, the leader replies to the client who requested the action.
-}