module Network.Serverless.Execute.Backend
(
Backend (..)
, BackendM
, const_SERVERLESS_EXECUTOR_MODE
, ExecutorFinalStatus (..)
, ExecutorStatus(..)
, ExecutorPendingStatus (..)
, waiting, waitingDesc
, submitted, submittedDesc
, started, startedDesc
, liftIO
, getExecutablePath
) where
import Control.Monad.IO.Class
import Control.Monad.Trans.Reader
import Data.Text (Text)
import System.Environment
import Network.Serverless.Execute.Internal
pendingStatus :: ExecutorPendingStatus -> BackendM ()
pendingStatus s = BackendM ask >>= liftIO . ($ s)
waiting :: BackendM ()
waiting = pendingStatus $ ExecutorWaiting Nothing
waitingDesc :: Text -> BackendM ()
waitingDesc = pendingStatus . ExecutorWaiting . Just
submitted :: BackendM ()
submitted = pendingStatus $ ExecutorSubmitted Nothing
submittedDesc :: Text -> BackendM ()
submittedDesc = pendingStatus . ExecutorSubmitted . Just
started :: BackendM ()
started = pendingStatus $ ExecutorStarted Nothing
startedDesc :: Text -> BackendM ()
startedDesc = pendingStatus . ExecutorStarted . Just