daemons alternatives and similar packages
Based on the "Control" category.
Alternatively, view daemons alternatives based on common mentions on social networks and blogs.
-
transient
A full stack, reactive architecture for general purpose programming. Algebraic and monadically composable primitives for concurrency, parallelism, event handling, transactions, multithreading, Web, and distributed computing with complete de-inversion of control (No callbacks, no blocking, pure state) -
classy-prelude
Type classes for mapping, folding, and traversing monomorphic containers -
classy-prelude-yesod
Type classes for mapping, folding, and traversing monomorphic containers -
distributed-closure
Serializable closures for distributed programming. -
auto
Haskell DSL and platform providing denotational, compositional api for discrete-step, locally stateful, interactive programs, games & automations. http://hackage.haskell.org/package/auto -
extensible-effects
Extensible Effects: An Alternative to Monad Transformers -
selective
Selective Applicative Functors: Declare Your Effects Statically, Select Which to Execute Dynamically -
ComonadSheet
A library for expressing "spreadsheet-like" computations with absolute and relative references, using fixed-points of n-dimensional comonads. -
abstract-par
Type classes generalizing the functionality of the 'monad-par' library. -
hask
Category theory for Haskell with a lens flavor (you need GHC 7.8.3, not 7.8.2 to build this!) -
these
An either-or-both data type, with corresponding hybrid error/writer monad transformer. -
transient-universe
A Cloud monad based on transient for the creation of Web and reactive distributed applications that are fully composable, where Web browsers are first class nodes in the cloud -
cloud-haskell
This is an umbrella development repository for Cloud Haskell -
distributed-fork
A distributed data processing framework in Haskell. -
monad-validate
(NOTE: REPOSITORY MOVED TO NEW OWNER: https://github.com/lexi-lambda/monad-validate) A Haskell monad transformer library for data validation -
distributed-process-platform
DEPRECATED (Cloud Haskell Platform) in favor of distributed-process-extras, distributed-process-async, distributed-process-client-server, distributed-process-registry, distributed-process-supervisor, distributed-process-task and distributed-process-execution -
effect-monad
Provides 'graded monads' and 'parameterised monads' to Haskell, enabling fine-grained reasoning about effects. -
operational
Implement monads by specifying instructions and their desired operational semantics. -
freer-effects
An implementation of "Freer Monads, More Extensible Effects". -
ixmonad
Provides 'graded monads' and 'parameterised monads' to Haskell, enabling fine-grained reasoning about effects. -
monad-control
Lift control operations, like exception catching, through monad transformers -
monad-time
Type class for monads which carry the notion of the current time.
Tired of breaking your main and manually rebasing outdated pull requests?
Do you think we are missing an alternative of daemons or a related project?
README
daemons
Daemons in Haskell made fun and easy
Example
Here's AddOne, a simple daemon that waits for a number and responds with the incremented number.
import Data.Default ( def )
import System.Environment ( getArgs )
import System.Daemon
addOne :: Int -> IO Int
addOne n = return (n + 1)
main :: IO ()
main = do
ensureDaemonRunning "addOne" def addOne
[n] <- getArgs
res <- runClient "localhost" 5000 ((read n) :: Int)
print (res :: Maybe Int)
Running it, we see:
% addone 22
Daemon started on port 5000
Just 23
% addone 41
Just 42
The two important functions above are ensureDaemonRunning
, which
checks if a daemon named addOne
is already running, and starts it if
not, and runClient
which connects to the daemon running on
localhost:5000
, passes it a number, and waits for the response.
What would I use this for?
You can use the
runDetached
fromSystem.Posix.Daemon
to turn your program into a daemon for Unix-like systems. You'd want to do this for practically every program that's meant to run as a server.You can use the functions from
Control.Pipe.C3
,Socket
, andSerialize
to communicate with running Haskell program. At the simplest, you could query the program for its status, or instruct it to shutdown cleanly. A more complex use would be adding a full REPL into a running Haskell process (thinkerl -remsh
).You can use the helpers from
System.Daemon
to trivially do the above. Check out the following tutorials and examples for details.
Tutorials and examples
Memo - in which we write an in-memory key-value store,
-
- a task queue using the streaming interface of
daemons
.
- a task queue using the streaming interface of
Installation
This package is on Hackage. To install it, run:
cabal update
cabal install daemons
Modules
Control.Pipe.C3
provides simple RPC-like wrappers for pipes.Control.Pipe.Serialize
provides pipes to serialize and deserialize streams of strictByteString
s using cereal.Control.Pipe.Socket
provides functions to setup strictByteString
pipes around sockets.System.Daemon
provides a high-level interface to starting daemonized programs that are controlled through sockets.System.Posix.Daemon
provides a low-level interface to starting, and controlling detached jobs.
See also
pipes
The Pipes TutorialC3
Wikipedia