hint-server-1.3.0: A server process that runs hint.

Safe HaskellNone

Language.Haskell.Interpreter.Server

Contents

Description

This module provides a server process (implemented using eprocess) that can receive and run actions in the Interpreter monad.

Synopsis

Types

data ServerHandle Source

The server handle. It's returned on process creation and should be used afterwards to send messages to it

Functions

start :: IO ServerHandleSource

Starts the server. Usage: handle <- start

stop :: ServerHandle -> IO ()Source

Stops the server. Usage: stop serverhandle

runInSource

Arguments

:: ServerHandle

The handle of the server that will run the action

-> InterpreterT IO a

The action to be run

-> IO (Either InterpreterError a) 

Runs the action. Usage: result <- runIn serverhandle action

asyncRunInSource

Arguments

:: ServerHandle

The handle of the server that will run the action

-> InterpreterT IO a

The action to be run

-> IO (MVar (Either InterpreterError a)) 

Asynchronically runs an action and returns the MVar that will be filled with the result when it's there. Usage: mvar <- asyncRunIn serverhandle action

flushSource

Arguments

:: ServerHandle

The handle of the server that will run the action

-> IO (Either InterpreterError ())

The meaningful results are stored in the corresponding mvars

Runs all the pending actions (those that where run using asyncRunIn. Usage: flush serverhandle