Liking cljdoc? Tell your friends :D

socket-json-rpc.server


def-cljmacro

(def- sym init)

Define a new private variable in 'defn-' style.

Define a new private variable in 'defn-' style.
sourceraw docstring

defprocedurecljmacro

(defprocedure sym named-args func)

Creates a new procedure that can be called through the JSON-RPC interface. The supplied function receives two arguments automatically - 'args', which is a vector of unnamed arguments (i.e. the caller supplied an Array), and 'notification', which is true when the function should not return anything. The named-args argument takes a vector of named arguments, and is used if the caller supplied a parameters Object. The names must be specified in the same order as they should appear in the unnamed arguments version.

Creates a new procedure that can be called through the JSON-RPC interface.
The supplied function receives two arguments automatically - 'args', which is
a vector of unnamed arguments (i.e. the caller supplied an Array), and
'notification', which is true when the function should not return anything.
The named-args argument takes a vector of named arguments, and is used if the
caller supplied a parameters Object. The names must be specified in the same
order as they should appear in the unnamed arguments version.
sourceraw docstring

do-batchcljmacro

(do-batch input)

Organises the execution of each entry in a batch, as well as the collation and return of the outputs of each entry. Enforces not returning anything if the call is a notification.

Organises the execution of each entry in a batch, as well as the collation and
return of the outputs of each entry. Enforces not returning anything if the call
is a notification.
sourceraw docstring

do-singlecljmacro

(do-single input)

Very simply executes a single procedure call. Enforces not returning anything if the call is a notification.

Very simply executes a single procedure call. Enforces not returning anything
if the call is a notification.
sourceraw docstring

errorclj

(error err)
(error code message)

Generates the return JSON for an error condition.

Generates the return JSON for an error condition.
sourceraw docstring

named-paramscljmacro

(named-params call params id method)

Organises named parameters into a vector as if it were a positional parameter call, then calls the procedure as per normal.

Organises named parameters into a vector as if it were a positional parameter
call, then calls the procedure as per normal.
sourceraw docstring

positional-paramscljmacro

(positional-params call params id method)

Just passes the vector of arguments to the procedure as-is.

Just passes the vector of arguments to the procedure as-is.
sourceraw docstring

respondclj

(respond result)

Generates the return JSON for a function's return value.

Generates the return JSON for a function's return value.
sourceraw docstring

startclj

(start port)
(start port backlog)
(start port backlog bind-addr)

Creates a new asynchronous socket server with a given port, optional backlog (maximum queue length of incoming connection indications, 50 by default) and optional bind address (localhost by default), blocking the calling thread in the process. Use this server instead of the async server to prevent the main thread from exiting.

Creates a new asynchronous socket server with a given port, optional backlog
(maximum queue length of incoming connection indications, 50 by default) and
optional bind address (localhost by default), blocking the calling thread in
the process. Use this server instead of the async server to prevent the main
thread from exiting.
sourceraw docstring

start-asyncclj

(start-async port)
(start-async port backlog)
(start-async port backlog bind-addr)

Creates a new asynchronous socket server with a given port, optional backlog (maximum queue length of incoming connection indications, 50 by default) and optional bind address (localhost by default), and returns immediately with a communications channel that can be used to command the server to shut down.

Creates a new asynchronous socket server with a given port, optional backlog
(maximum queue length of incoming connection indications, 50 by default) and
optional bind address (localhost by default), and returns immediately with a
communications channel that can be used to command the server to shut down.
sourceraw docstring

when-validcljmacro

(when-valid call body)

Continues with body if the RPC call is valid. Otherwise, returns an appropriate error. body automatically receives the variables 'params', 'id' and 'method'

Continues with body if the RPC call is valid. Otherwise, returns an appropriate
error. body automatically receives the variables 'params', 'id' and 'method'
sourceraw docstring

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

× close