Safe Haskell | None |
---|
Library exposing internal functions uses by Worker
useful work writing your own workers
- killWorker :: Worker a -> IO (Worker a)
- workerAlive :: Worker a -> IO Bool
- workerTimeout :: Worker a -> Int -> IO (Worker a)
- forkWorker :: Worker a -> Maybe (IO Handle) -> (Socket -> IO ()) -> IO ProcessID
- connectToWorker :: Worker a -> IO Handle
- mkSock :: FilePath -> IO Socket
- removeFileIfExists :: FilePath -> IO ()
- processAlive :: ProcessID -> IO Bool
Worker related
killWorker :: Worker a -> IO (Worker a)Source
Kill a worker. Takes an initialized worker, returns non-initialized one.
workerAlive :: Worker a -> IO BoolSource
Checks whether the worker is alive
Waits for a certain period of time and then kills the worker
:: Worker a | |
-> Maybe (IO Handle) | Where to redirect stdout |
-> (Socket -> IO ()) | Callback funcion |
-> IO ProcessID |
Fork a worker process
Connection related
connectToWorker :: Worker a -> IO HandleSource
Connect to the worker's socket and return a handle
Useful util functions
removeFileIfExists :: FilePath -> IO ()Source
Remove a file if it exists. Should be thread-safe.
processAlive :: ProcessID -> IO BoolSource
Checks whether the process is alive hacky