| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Lambda
Synopsis
- run :: Application -> IO ()
- handleRequest :: Application -> Int -> ByteString -> IO ()
Documentation
run :: Application -> IO () Source #
Run an Application.
Continuously reads requests from stdin. Each line should be a a JSON
document as described in decodeInput.
All requests will be timed out after 2 seconds. If any exception
is thrown while processing the request this will return an HTTP 500
Internal Server Error.
If you need more control use handleRequest directly.
Arguments
| :: Application | |
| -> Int | Timeout in microseconds |
| -> ByteString | The request (see |
| -> IO () |
Parse and handle the request.
- Returns 504 if no response is available after the specified timeout.
- Returns 500 if an exception occurs while processing the request.
- Throws an exception if the input cannot be parsed.