(index ("connect-handler" 0) ("receive-request" 660) ("request-disconnect?" 978) ("request-sender" 1139) ("request-path" 1280) ("request-headers" 1414) ("request-header" 1581) ("request-method" 1820) ("request-body" 1996) ("request-data" 2126) ("request-id" 2438) ("request-type" 2571) ("request-uri" 2760) ("send-response" 2907) ("send-http-response" 3060) ("handler-response-id" 3537) ("handler-response-endpoint" 3660) ("handler-request-id" 3801) ("handler-request-endpoint" 3921) ("current-request" 4059) ("current-http-request" 4246) ("current-http-response" 4537) ("handler-start" 4860) ("send-response" 5227) ("send-http-response" 5380))
(def (sig (procedure "(connect-handler id response-endpoint request-endpoint #!optional request-id)" (id connect-handler))) (p "Creates and connects two " (int-link "zmq") " sockets for communicating with a Mongrel2 server. The " (tt "id") " is used as the PUB socket's identity and " (tt "request-endpoint") " is a zmq endpoint string for that socket to connect to. Correspondingly, " (tt "request-endpoint") " is the zmq endpoint string for the PULL socket to connect to. Optionally, an identity for that socket can be given as " (tt "request-id") ". The return value is an opaque connection record which is further referred to as a " (i "connection") "."))
(def (sig (procedure "(receive-request connection)" (id receive-request))) (p "Receives a request from " (tt "connection") ". This will block the current thread until a request is available. Requests are returned in the form of a record which can be inspected with several procedures also available in this module."))
(def (sig (procedure "(request-disconnect? request)" (id request-disconnect?))) (p "Checks whether the given " (tt "request") " signifies a disconnect event."))
(def (sig (procedure "(request-sender request)" (id request-sender))) (p "Returns the given " (tt "request") "'s sender UUID as a string."))
(def (sig (procedure "(request-path request)" (id request-path))) (p "Returns the given " (tt "request") "'s URI path as a string."))
(def (sig (procedure "(request-headers request)" (id request-headers))) (p "Returns the given " (tt "request") "'s headers as an alist with the keys being symbols."))
(def (sig (procedure "(request-header name request)" (id request-header))) (p "Return the value of " (tt "request") "'s header " (tt "name") " which must be a symbol. If there no header of that name is found, " (tt "#f") " is returned."))
(def (sig (procedure "(request-method request)" (id request-method))) (p "Returns the given " (tt "request") "'s method as a symbol, e.g. " (tt "JSON") " or " (tt "GET") "."))
(def (sig (procedure "(request-body request)" (id request-body))) (p "Returns the given " (tt "request") "'s body as a string."))
(def (sig (procedure "(request-data request)" (id request-data))) (p "Returns the given " (tt "request") "'s body in a structured format. This depends on the request's method. Currently it will only handle requests of the type " (tt "JSON") " and return the body's contents parsed by the " (tt "json") " egg."))
(def (sig (procedure "(request-id request)" (id request-id))) (p "Returns the given " (tt "request") "'s listener id as a string."))
(def (sig (procedure "(request-type)" (id request-type))) (p "Returns the given " (tt "request") "'s type as a symbol. This is either " (tt "json") ", " (tt "xml") " or " (tt "http") "."))
(def (sig (procedure "(request-uri)" (id request-uri))) (p "Returns the given " (tt "request") "'s URI as a " (int-link "uri-common") " record."))
(def (sig (procedure "(send-response request response)" (id send-response))) (p "Sends a " (tt "response") " string for the given " (tt "request") "."))
(def (sig (procedure "(send-http-response request #!key code reason body headers response)" (id send-http-response))) (p "Sends an HTTP response for the given " (tt "request") ". The arguments are exactly the same as those of " (int-link "spiffy") "'s " (tt "send-response") " with the addition of the keyword argument " (tt "response") " which can be used to pass in an " (int-link "intarweb") " response record to be used as a basis (default is an empty response record)."))
(def (sig (parameter "(handler-response-id [id])" (id handler-response-id))) (p "The response socket's identity string."))
(def (sig (parameter "(handler-response-endpoint [endpoint])" (id handler-response-endpoint))) (p "The response socket's endpoint string."))
(def (sig (parameter "(handler-request-id [id])" (id handler-request-id))) (p "The request socket's identity string."))
(def (sig (parameter "(handler-request-endpoint [endpoint])" (id handler-request-endpoint))) (p "The request socket's endpoint string."))
(def (sig (parameter "(current-request [request])" (id current-request))) (p "The current Mongrel2 request record (see the " (tt "mongrel2-lolevel") " module for available accessors)."))
(def (sig (parameter "(current-http-request [http-request])" (id current-http-request))) (p "If the " (tt "current-request") "'s " (tt "request-type") " is " (tt "http") ", this parameter holds a corresponding " (int-link "intarweb") " request record. Otherwise it will be " (tt "#f") "."))
(def (sig (parameter "(current-http-response [http-response])" (id current-http-response))) (p "If the " (tt "current-request") "'s " (tt "request-type") " is " (tt "http") ", this parameter holds an " (int-link "intarweb") " response record which can be used to build up a response. Otherwise it will be " (tt "#f") "."))
(def (sig (procedure "(handler-start [handler])" (id handler-start))) (p "Starts the handler mainloop. " (tt "handler") " is a thunk which is called for each incoming request with the above paramters set accordingly. It is expected to send a response to " (tt "current-request") ". See " (tt "send-response") " and " (tt "send-http-response") " on how to do that."))
(def (sig (procedure "(send-response body)" (id send-response))) (p "Sends the string " (tt "body") " as the response for " (tt "current-request") "."))
(def (sig (procedure "(send-http-response #!key code reason body headers)" (id send-http-response))) (p "Sends a HTTP response for " (tt "current-request") ". This procedure works exactly like " (int-link "spiffy") "'s " (tt "send-response") "."))
