Liking cljdoc? Tell your friends :D

capra.server

The namespace for running the Capra server.

The namespace for running the Capra server.
raw docstring

ResponseBodycljprotocol

write-body-to-socketclj

(write-body-to-socket body response headers buffer socket async? callback)
source

run-serverclj

(run-server handler & {:as options})

Start a web server in a new thread with the supplied Ring handler and options. Returns a java.io.Closeable instance that can be used to stop the adapter via the close method.

Accepts the following options:

  • :async? - if true, expect 3-arity async Ring handlers (defaults to false)
  • :control-queue-size - the max number of queued control events (default 32)
  • :direct-read-buffer? - allocate a direct buffer for reads (default true)
  • :error-handler - an asynchronous Ring handler function used to handle uncaught exceptions (defaults to sending a 500 Internal Server Error).
  • :error-logger - a function that takes a single exception argument and logs it somehow (defaults to printing to err)
  • :executor - the ExecutorService to use for running handlers
  • :port - the port number to listen on (defaults to 80)
  • :read-buffer-size - the size of the buffer to use when reading from the socket (defaults to 8K)
  • :recv-buffer-size - the receive buffer size (i.e. the SO_RCVBUF option)
  • :response-buffer-size - the size of the buffer used when constructing the response, which must be at least large enough to contain the response status line and headers (defaults to 32K)
  • :reuse-address? - sets the SO_REUSEADDR socket option (default false)
  • :stream-buffer-size - the size of the buffer used to read in the body of the request when streaming (defaults to 8K)
  • :write-buffer-size - the write buffer size in bytes (default 32K)
  • :write-queue-size - the max number of writes in the queue (default 64)
Start a web server in a new thread with the supplied Ring handler and
options. Returns a `java.io.Closeable` instance that can be used to stop the
adapter via the `close` method.

Accepts the following options:

- `:async?` - if true, expect 3-arity async Ring handlers (defaults to false)
- `:control-queue-size` - the max number of queued control events (default 32)
- `:direct-read-buffer?` - allocate a direct buffer for reads (default true)
- `:error-handler` - an asynchronous Ring handler function used to handle
  uncaught exceptions (defaults to sending a 500 Internal Server Error).
- `:error-logger` - a function that takes a single exception argument and
  logs it somehow (defaults to printing to *err*)
- `:executor` - the ExecutorService to use for running handlers
- `:port` - the port number to listen on (defaults to 80)
- `:read-buffer-size` - the size of the buffer to use when reading from the
  socket (defaults to 8K)
- `:recv-buffer-size` - the receive buffer size (i.e. the SO_RCVBUF option)
- `:response-buffer-size` - the size of the buffer used when constructing
  the response, which must be at least large enough to contain the response
  status line and headers (defaults to 32K)
- `:reuse-address?` - sets the SO_REUSEADDR socket option (default false)
- `:stream-buffer-size` - the size of the buffer used to read in the body of
  the request when streaming (defaults to 8K)
- `:write-buffer-size` - the write buffer size in bytes (default 32K)
- `:write-queue-size` - the max number of writes in the queue (default 64)
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close