Browse Source

junction: remote control: implement start robot command handler

master
Denis Tereshkin 4 years ago
parent
commit
2d146d8a16
  1. 7
      src/ATrade/Driver/Junction/RemoteControl.hs

7
src/ATrade/Driver/Junction/RemoteControl.hs

@ -8,7 +8,8 @@ module ATrade.Driver.Junction.RemoteControl
) where ) where
import ATrade.Driver.Junction.JunctionMonad (JunctionEnv (peLogAction, peRemoteControlSocket, peRobots), import ATrade.Driver.Junction.JunctionMonad (JunctionEnv (peLogAction, peRemoteControlSocket, peRobots),
JunctionM) JunctionM,
startRobot)
import ATrade.Driver.Junction.RobotDriverThread (stopRobot) import ATrade.Driver.Junction.RobotDriverThread (stopRobot)
import ATrade.Driver.Junction.Types (StrategyInstanceDescriptor) import ATrade.Driver.Junction.Types (StrategyInstanceDescriptor)
import ATrade.Logging (Severity (Info), import ATrade.Logging (Severity (Info),
@ -96,7 +97,9 @@ handleRemoteControl timeout = do
response <- handleRequest request response <- handleRequest request
liftIO $ send sock [] (makeRemoteControlResponse response) liftIO $ send sock [] (makeRemoteControlResponse response)
where where
handleRequest (StartRobot inst) = undefined handleRequest (StartRobot inst) = do
startRobot inst
return ResponseOk
handleRequest (StopRobot instId) = do handleRequest (StopRobot instId) = do
robotsRef <- asks peRobots robotsRef <- asks peRobots
robots <- readIORef robotsRef robots <- readIORef robotsRef

Loading…
Cancel
Save