From 2d146d8a160cadab834c166182728393655b2a21 Mon Sep 17 00:00:00 2001 From: Denis Tereshkin Date: Tue, 4 Jan 2022 23:11:50 +0700 Subject: [PATCH] junction: remote control: implement start robot command handler --- src/ATrade/Driver/Junction/RemoteControl.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ATrade/Driver/Junction/RemoteControl.hs b/src/ATrade/Driver/Junction/RemoteControl.hs index 0287f38..95d3f24 100644 --- a/src/ATrade/Driver/Junction/RemoteControl.hs +++ b/src/ATrade/Driver/Junction/RemoteControl.hs @@ -8,7 +8,8 @@ module ATrade.Driver.Junction.RemoteControl ) where import ATrade.Driver.Junction.JunctionMonad (JunctionEnv (peLogAction, peRemoteControlSocket, peRobots), - JunctionM) + JunctionM, + startRobot) import ATrade.Driver.Junction.RobotDriverThread (stopRobot) import ATrade.Driver.Junction.Types (StrategyInstanceDescriptor) import ATrade.Logging (Severity (Info), @@ -96,7 +97,9 @@ handleRemoteControl timeout = do response <- handleRequest request liftIO $ send sock [] (makeRemoteControlResponse response) where - handleRequest (StartRobot inst) = undefined + handleRequest (StartRobot inst) = do + startRobot inst + return ResponseOk handleRequest (StopRobot instId) = do robotsRef <- asks peRobots robots <- readIORef robotsRef