distributed-dataset-0.0.1.0: A distributed data processing framework in pure Haskell
Safe HaskellNone
LanguageHaskell2010

Control.Distributed.Fork.Backend

Description

You only need this module if you want to create a new backend for distributed-dataset.

Synopsis

Writing a Backend.

newtype Backend Source #

Backend is responsible for running your functions in a remote environment.

Should run the current binary in the target environment, put the given string as standard input and return the executables answer on the standard output. | BackendM is essentially IO, but also has the ability to report the status of the executor.

Constructors

Backend 

data BackendM a Source #

Instances

Instances details
Monad BackendM Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Methods

(>>=) :: BackendM a -> (a -> BackendM b) -> BackendM b Source #

(>>) :: BackendM a -> BackendM b -> BackendM b Source #

return :: a -> BackendM a Source #

Functor BackendM Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Methods

fmap :: (a -> b) -> BackendM a -> BackendM b Source #

(<$) :: a -> BackendM b -> BackendM a Source #

Applicative BackendM Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Methods

pure :: a -> BackendM a Source #

(<*>) :: BackendM (a -> b) -> BackendM a -> BackendM b Source #

liftA2 :: (a -> b -> c) -> BackendM a -> BackendM b -> BackendM c Source #

(*>) :: BackendM a -> BackendM b -> BackendM b Source #

(<*) :: BackendM a -> BackendM b -> BackendM a Source #

MonadIO BackendM Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Methods

liftIO :: IO a -> BackendM a Source #

MonadUnliftIO BackendM Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Methods

askUnliftIO :: BackendM (UnliftIO BackendM) Source #

withRunInIO :: ((forall a. BackendM a -> IO a) -> IO b) -> BackendM b Source #

MonadThrow BackendM Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Methods

throwM :: Exception e => e -> BackendM a Source #

MonadCatch BackendM Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Methods

catch :: Exception e => BackendM a -> (e -> BackendM a) -> BackendM a Source #

MonadMask BackendM Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Methods

mask :: ((forall a. BackendM a -> BackendM a) -> BackendM b) -> BackendM b Source #

uninterruptibleMask :: ((forall a. BackendM a -> BackendM a) -> BackendM b) -> BackendM b Source #

generalBracket :: BackendM a -> (a -> ExitCase b -> BackendM c) -> (a -> BackendM b) -> BackendM (b, c) Source #

argExecutorMode :: String Source #

We switch to executor mode only when argv[1] == argExecutorMode.

Reporting status

data ExecutorFinalStatus a Source #

Instances

Instances details
Functor ExecutorFinalStatus Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Eq a => Eq (ExecutorFinalStatus a) Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Generic (ExecutorFinalStatus a) Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

Associated Types

type Rep (ExecutorFinalStatus a) :: Type -> Type Source #

Binary a => Binary (ExecutorFinalStatus a) Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

type Rep (ExecutorFinalStatus a) Source # 
Instance details

Defined in Control.Distributed.Fork.Internal

type Rep (ExecutorFinalStatus a) = D1 ('MetaData "ExecutorFinalStatus" "Control.Distributed.Fork.Internal" "distributed-dataset-0.0.1.0-4FGt6FsKf56ZX45G52Nsw" 'False) (C1 ('MetaCons "ExecutorFailed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "ExecutorSucceeded" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

Utils

runBackend :: Closure (Dict (Serializable i)) -> Closure (IO i) -> Backend -> IO (Handle i) Source #

Given an IO action and a static proof that the result is Serializable, this function runs the action using the Backend in a separate thread and returns a TVar holding the ExecutorStatus.

Re-exports

liftIO :: MonadIO m => IO a -> m a Source #

Lift a computation from the IO monad.

getExecutablePath :: IO FilePath Source #

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 base 4.11.0.0, getExecutablePath resolves symlinks on Windows. If an executable is launched through a symlink, getExecutablePath returns the absolute path of the original executable.

Since: base-4.6.0.0