Liking cljdoc? Tell your friends :D

ring.adapter.jdk


->Configclj

(->Config opt)

Build a Config object out from a Clojure map.

Build a Config object out from a Clojure map.
sourceraw docstring

closeclj

(close server)

Close the server (the same as stop).

Close the server (the same as stop).
sourceraw docstring

serverclj

(server handler)
(server handler opt)

Given a Clojure Ring handler (arity-1 function) and, optionally a Clojure map of options, run an HTTP server in a separate thread. Return an instance of the ring.adapter.jdk.Server class. Needs to be closed afterwards; can be used with the with-open macro.

Optional parameters:

  • :host is the host name to bind (default is 127.0.0.1).
  • :port is the port number to listen (default is 8080).
  • :threads is the number of threads to use. When > 0, then a custom instance of FixedThreadPool is used.
  • :executor is a custom Executor object, if needed.
  • :root-path is a string, a global path prefix for the handier.
  • :stop-delay-sec is a number of seconds to wait when closing the server;
  • :socket-backlog is a number, an option for socket when binding a server.
Given a Clojure Ring handler (arity-1 function)
and, optionally a Clojure map of options, run
an HTTP server in a separate thread. Return an
instance of the `ring.adapter.jdk.Server` class.
Needs to be closed afterwards; can be used with
the `with-open` macro.

Optional parameters:
- `:host` is the host name to bind (default is 127.0.0.1).
- `:port` is the port number to listen (default is 8080).
- `:threads` is the number of threads to use. When > 0,
   then a custom instance of FixedThreadPool is used.
- `:executor` is a custom Executor object, if needed.
- `:root-path` is a string, a global path prefix for
   the handier.
- `:stop-delay-sec` is a number of seconds to wait when
  closing the server;
- `:socket-backlog` is a number, an option for socket
  when binding a server.
sourceraw docstring

stopclj

(stop server)

Close the server (the same as close).

Close the server (the same as close).
sourceraw docstring

with-servercljmacro

(with-server [handler opt] & body)

A wrapper on top of the with-open macro. Takes a handler (mandatory) and an optional map of parameters. Runs the server while the body is being executed. Closes the server instance on exit.

A wrapper on top of the `with-open` macro. Takes a handler
(mandatory) and an optional map of parameters. Runs the server
while the body is being executed. Closes the server instance
on exit.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close