This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
Added
start
andstart-async
functions to serve incoming socket RPC requestsdefprocedure
to create new procedures that can then be called remotelyrespond
anderror
for server-side procedures to generate responsessocket-io
private function to handle reading and writing to server socketsexecute
private function to parse the request and decide whether the request
is a single procedure call or a batchdo-single
anddo-batch
to separate individual calls, and execute, before
arranging return JSONexecute-single
to execute the map representation of a single procedure call,
if it is validwhen-valid
executes its body if the input toexecute-single
is in a valid
JSON-RPC request formatnamed-params
andpositional-params
organise input parameters into a
consistent format, before calling the procedure defined bydefprocedure
with-server
macro for clients to call procedures on a servernotify
can be wrapped around a procedure call if a client does not want a
responsesocket-io
to send a request to the specified server, then read the response,
organising responses byid
in the case of a batch.read-all
handles reading the character count at the top of the response, then
reading an appropriate number of characters based on that countparse-body
converts the body of awith-server
block from clojure function
form to JSON-RPC form, checking for validity- README with basic API documentation