processCommandObj :: (Proxy p) => CommandObj -> Producer (StateP Options (ReaderP Settings p)) ClientDirective GHC.Ghc ()
processCommandObj (command,opts') = do
  let logmsg = respond . ClientLog "processCommandObj"
  logmsg $ "Processing command: " ++ show command
  opts <- use ghcOpts
  when (opts /= opts') $ do
    logmsg "Reconfigure needed"
    ghcOpts .= opts'
    needReconfig .= True
    reconfigure
  liftP $ writeRef refErrors S.empty
  result <- runCommand command
  logmsg "Finished executing command. Start collecting errors"
  errors <- liftP $ readRef refErrors
  logmsg "Responding with errors"
  traverse_ processError errors
  logmsg "Done. Returning ClientExit status"
  respond $ ClientExit result
  return ()
processCommandObj :: (Proxy p) => CommandObj -> Producer (StateP Options (ReaderP Settings p)) ClientDirective GHC.Ghc ()
processCommandObj (command,opts') = do
  let logmsg = respond . ClientLog "processCommandObj"
  logmsg $ "Processing command: " ++ show command
  opts <- use ghcOpts
  when (opts /= opts') $ do
    logmsg "Reconfigure needed"
    ghcOpts .= opts'
    needReconfig .= True
    reconfigure
  liftP $ writeRef refErrors S.empty
  result <- runCommand command
  logmsg "Finished executing command. Start collecting errors"
  errors <- liftP $ readRef refErrors
  logmsg "Responding with errors"
  traverse_ processError errors
  logmsg "Done. Returning ClientExit status"
  respond $ ClientExit result
  return ()
processCommandObj (command,opts') = do
  let logmsg = respond . ClientLog "processCommandObj"
  logmsg $ "Processing command: " ++ show command
  opts <- use ghcOpts
  when (opts /= opts') $ do
    logmsg "Reconfigure needed"
    ghcOpts .= opts'
    needReconfig .= True
    reconfigure
  liftP $ writeRef refErrors S.empty
  result <- runCommand command
  logmsg "Finished executing command. Start collecting errors"
  errors <- liftP $ readRef refErrors
  logmsg "Responding with errors"
  traverse_ processError errors
  logmsg "Done. Returning ClientExit status"
  respond $ ClientExit result
  return ()