commander/client
0.1.0Table of Contents
System Information
Definition Index
-
ORG.SHIRAKUMO.COMMANDER.CLIENT
No documentation provided.-
EXTERNAL CLASS CLIENT
Representation of a basic client. The hostname and port to connect to on START can be passed as initargs. The additional initarg :RUN-SYNCHRONOUS, if passed as true, will cause START to execute RUN synchronously within the calling thread, rather than spinning up a separate thread. Depending on implementation support, the client may spin up another thread regardless though, in order to perform connection keepalive pings. See HOSTNAME See PORT See POLL-MESSAGE See WAIT-MESSAGE See HANDLE-MESSAGE See DEFINE-HANDLER See REMOTE-EVAL See EVAL-FROM-SERVER-ALLOWED-P See ORG.SHIRAKUMO.COMMANDER.SUPPORT:CLIENT
-
EXTERNAL CLASS HEADLESS-CLIENT
Client that is meant for headless use of a Commander server. This client type handles all other specified message types, and easily allows you to evaluate forms on the remote server. It also handles redirecting of io on server streams to streams on the client side. It notably however will not provide a debugger, instead declining any debugger invocations. See FIND-STREAM See CLIENT (type)
-
EXTERNAL FUNCTION QUERY-UNWRAP
- HANDLER
- COMMAND
- &REST
- ARGS
Convenience function to call UNWRAP-MESSAGE on QUERY. See QUERY See UNWRAP-MESSAGE
-
EXTERNAL GENERIC-FUNCTION ALIVE-P
- THREADED
-
EXTERNAL GENERIC-FUNCTION CLIENT
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION (SETF CLIENT)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION CONNECTED-P
- CLIENT
Returns true if the client is still connected. Note that this does not guarantee that a write or read on the client's stream will succeed. See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION EVAL-FROM-SERVER-ALLOWED-P
- OBJECT
Accesses whether the server is allowed to send eval requests to this client. See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION (SETF EVAL-FROM-SERVER-ALLOWED-P)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION FIND-STREAM
- ID
- CLIENT
Used to determine the corresponding stream to use on the client side. Users are encouraged to add methods on subclasses of HEADLESS-CLIENT that will return the intended streams to connect IO to. By default it will try to find a stream based on the identifier's symbol. If it is bound, that global binding value will be used. If not, then NIL is used as the identifier instead, which by default returns in a NIL return, rejecting the stream (and causing no IO to be connected). See HEADLESS-CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION HANDLE-MESSAGE
- CLIENT
- MESSAGE
Process the given message. Users are encouraged to add methods to this function to handle message types for their client subclasses. For the default CLIENT class, the following message types are handled: V1:PING V1:CONNECT V1:DISCONNECT V1:OK V1:FAILURE V1:RETURN See ORG.SHIRAKUMO.COMMANDER.PROTOCOL.V1:PING See ORG.SHIRAKUMO.COMMANDER.PROTOCOL.V1:CONNECT See ORG.SHIRAKUMO.COMMANDER.PROTOCOL.V1:DISCONNECT See ORG.SHIRAKUMO.COMMANDER.PROTOCOL.V1:OK See ORG.SHIRAKUMO.COMMANDER.PROTOCOL.V1:RETURN See ORG.SHIRAKUMO.COMMANDER.PROTOCOL.V1:FAILURE See DEFINE-HANDLER See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION HOSTNAME
- OBJECT
Returns the hostname to which the client connects. See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION POLL-MESSAGE
- CLIENT
- &KEY
- DEFAULT
Return the next available message, if any. Returns DEFAULT if no message is available. See ORG.SHIRAKUMO.COMMANDER.SUPPORT:MINIQUEUE-POP See WAIT-MESSAGE See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION PORT
- OBJECT
Returns the port to which the client connects. See ORG.SHIRAKUMO.COMMANDER.PROTOCOL:*STANDARD-PORT* See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION QUERY
- CLIENT
- MESSAGE
- &REST
- ARGS
Send a query and block until a reply is received. Once a reply has been received, that message is returned. If the reply never arrives (because the client is stopped, its stream breaks, or some other error), then NIL is returned instead. See SEND! See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION REMOTE-EVAL
- CLIENT
- FORM
- &KEY
- PACKAGE
- &ALLOW-OTHER-KEYS
Runs the FORM on the remote server the CLIENT is connected to. Note that FORM must be a Lisp form which can be turned to a string representation via PRIN1. Further, the code will be evaluated in the given package on the server side. If the package is NIL, the *PACKAGE* will be whatever it is on the server side already. Returns whatever values are returned on the server side. See CLIENT (type) See WITH-REMOTE-EVAL
-
EXTERNAL GENERIC-FUNCTION REPLY-TO
- CONDITION
The ID of the message to which this failure relates. See QUERY-FAILURE (type)
-
EXTERNAL GENERIC-FUNCTION RUN
- THREADED
The function to run within the THREADED's thread. Within primary methods of RUN, the threaded's THREAD is set, and the STOP restart is active. See THREADED (type)
-
EXTERNAL GENERIC-FUNCTION SEND
- CLIENT
- MESSAGE
- &REST
- ARGS
Sends a message over the client's stream. MESSAGE may either be a PROTO:MESSAGE instance, in which case ARGS are ignored, or a symbol naming a constructor function to which ARGS are passed before SENDing it out. While writing the message to the stream, the WRITE-LOCK is acquired to ensure no interleaved writes occur. Unlike SEND!, this function does not flush the underlying stream. See WRITE-LOCK See CLIENT (type) See SEND
-
EXTERNAL GENERIC-FUNCTION SEND!
- CLIENT
- MESSAGE
- &REST
- ARGS
Sends a message over the client's stream immediately. Like SEND, but flushes the stream. See SEND See CLIENT (type)
-
EXTERNAL GENERIC-FUNCTION START
- THREADED
Starts the threaded if it is not yet alive. Upon return, ALIVE-P should be true. See THREADED (type) See ALIVE-P
-
EXTERNAL GENERIC-FUNCTION STOP
- THREADED
Stops the threaded if it is currently alive. If this is executed within the thread managed by the threaded, then the STOP restart is invoked. Otherwise if the thread is alive, the STOP restart is invoked within it. After calling this function, ALIVE-P should be false. See THREADED (type) See ALIVE-P
-
EXTERNAL GENERIC-FUNCTION WAIT-MESSAGE
- CLIENT
- &KEY
- TIMEOUT
- TEST
Wait for the next available message. TEST can be used to specify a filter for susceptible messages. TIMEOUT can be used to specify a maximum number of seconds to wait for before returning. See ORG.SHIRAKUMO.COMMANDER.SUPPORT:MINIQUEUE-FIND-IF See POLL-MESSAGE See CLIENT (type)
-
EXTERNAL MACRO DEFINE-HANDLER
- CLASS
- TYPE
- ARGS
- &BODY
- BODY
Shorthand function to define a message type handler method. CLASS should be the name of the client class this handler is for. The client instance is also bound to this variable. TYPE should be the name of the message type to handle. ARGS can be a list of fields of the message to bind within the body of the handler, via the use of WITH-FIELDS. Within BODY, the following extra functions are available, each bound to names in the current package: SEND --- Shorthand for SEND! on the current client. REPLY --- Shorthand to use SEND with the current message's ID supplied as the :REPLY-TO initarg for the new message. OK --- Shorthand to send an V1:OK reply. RET --- Shorthand to send a V1:RETURN reply. FAIL --- Shorthand to send a V1:FAILURE reply. See HANDLE-MESSAGE See ORG.SHIRAKUMO.COMMANDER.PROTOCOL:WITH-FIELDS See ORG.SHIRAKUMO.COMMANDER.PROTOCOL.V1:OK See ORG.SHIRAKUMO.COMMANDER.PROTOCOL.V1:RETURN See ORG.SHIRAKUMO.COMMANDER.PROTOCOL.V1:FAILURE See CLIENT (type) -
EXTERNAL MACRO WITH-CLIENT
- VAR
- CLIENT
- &REST
- INITARGS
- &BODY
- BODY
Helper macro to lexically bind a client. Instantiates a CLIENT, binds it to VAR, calls START on the client, and then evaluates BODY forms. On exit from the body, STOP is called on the client. CLIENT can be either a CLIENT instance, or the name of a client class to construct via MAKE-INSTANCE. See CLIENT (type)
-
EXTERNAL MACRO WITH-REMOTE-EVAL
- CLIENT
- &KEY
- PACKAGE
- &BODY
- BODY
No documentation provided.
-