| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Distributed.Fork.Backend
Description
You only need this module if you want to create a new backend for distributed-fork.
See localProcessBackend for a minimal example.
- newtype Backend = Backend {
- bExecute :: ByteString -> BackendM ByteString
- data BackendM a
- argExecutorMode :: String
- data ExecutorFinalStatus a
- data ExecutorStatus a
- data ExecutorPendingStatus
- waiting :: BackendM ()
- waitingDesc :: Text -> BackendM ()
- submitted :: BackendM ()
- submittedDesc :: Text -> BackendM ()
- started :: BackendM ()
- startedDesc :: Text -> BackendM ()
- liftIO :: MonadIO m => forall a. IO a -> m a
- getExecutablePath :: IO FilePath
Writing a Backend.
Backend is responsible for running your functions in a remote environment.
See:
Constructors
| Backend | |
Fields
| |
BackendM is essentially IO, but also has the ability to report the status of the
executor.
argExecutorMode :: String Source #
We switch to executor mode only when argv[1] == argExecutorMode.
Reporting status
data ExecutorFinalStatus a Source #
Constructors
| ExecutorFailed Text | |
| ExecutorSucceeded a |
Instances
| Generic (ExecutorFinalStatus a) Source # | |
| Binary a => Binary (ExecutorFinalStatus a) Source # | |
| type Rep (ExecutorFinalStatus a) Source # | |
data ExecutorStatus a Source #
Constructors
| ExecutorPending ExecutorPendingStatus | |
| ExecutorFinished (ExecutorFinalStatus a) |
data ExecutorPendingStatus Source #
Constructors
| ExecutorWaiting (Maybe Text) | |
| ExecutorSubmitted (Maybe Text) | |
| ExecutorStarted (Maybe Text) |
waitingDesc :: Text -> BackendM () Source #
submittedDesc :: Text -> BackendM () Source #
startedDesc :: Text -> BackendM () Source #
Re-exports
getExecutablePath :: IO FilePath #
Returns the absolute pathname of the current executable.
Note that for scripts and interactive sessions, this is the path to the interpreter (e.g. ghci.)
Since: 4.6.0.0