This is the intercom Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:29:08 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
intercom
Intercom allows bidirectional message passing between javascript and lisp.
Aad Versteden <aad@knowified.com>
Aad Versteden <aad@knowified.com>
MIT
0.0.1
jsown
(system).
hunchentoot
(system).
bordeaux-threads
(system).
split-sequence
(system).
alexandria
(system).
packages.lisp
(file).
intercom.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
intercom/intercom.lisp
packages.lisp
(file).
intercom
(system).
*hydra-body-timeout*
(special variable).
*hydra-head-timeout*
(special variable).
*log-request-stream*
(special variable).
*remote-procedure-context*
(special variable).
activep
(function).
add-screen-gc-callback
(function).
add-session-gc-callback
(function).
auto-end-remote-procedure-p
(function).
(setf auto-end-remote-procedure-p)
(function).
define-remote-procedure
(macro).
handle-talk-request
(function).
message
(function).
remove-screen-gc-callback
(function).
remove-session-gc-callback
(function).
screen-var
(function).
(setf screen-var)
(function).
session-var
(function).
(setf session-var)
(function).
threadable-lambda
(macro).
translate-remote-procedure-name
(function).
with-error-as-fail
(macro).
with-screen-db-lock
(macro).
with-session-db-lock
(macro).
*auto-kill-rid*
(special variable).
*current-thread-start-internal-runtime*
(special variable).
*hydra-auth-lock*
(special variable).
*hydra-auth-store*
(special variable).
*hydra-body*
(special variable).
*hydra-head*
(special variable).
*hydra-head-id*
(special variable).
*log-stream-lock*
(special variable).
*remote-procedures*
(special variable).
*rid*
(special variable).
assert-eql-compatible
(macro).
assert-hydra-body
(macro).
assert-hydra-head
(macro).
assert-hydra-session-validation
(macro).
assert-nonempty-string
(macro).
assert-session
(function).
attach-head
(function).
build-active-authentication
(function).
build-active-hydra-body
(function).
call-remote-procedure
(function).
close-request-logging
(function).
copy-hydra-body
(function).
copy-hydra-head
(function).
copy-key-value-store
(function).
copy-session-validation
(function).
discover-hydra
(function).
discover-hydra-body
(function).
ensure-hhid
(function).
ensure-hydra
(function).
ensure-hydra-head
(function).
esc
(macro).
fetch-and-clear-messages
(function).
gc-hydra-bodies
(function).
gc-hydra-body
(function).
gc-hydra-head
(function).
gc-hydra-heads
(function).
generate-id
(function).
get-remote-procedure
(function).
hash-keys
(function).
hydra-body
(structure).
hydra-body-active-p
(function).
hydra-body-atime
(reader).
(setf hydra-body-atime)
(writer).
hydra-body-data
(reader).
(setf hydra-body-data)
(writer).
hydra-body-garbage-collected-body-p
(reader).
(setf hydra-body-garbage-collected-body-p)
(writer).
hydra-body-gc-callbacks
(reader).
(setf hydra-body-gc-callbacks)
(writer).
hydra-body-heads
(reader).
(setf hydra-body-heads)
(writer).
hydra-body-p
(function).
hydra-head
(structure).
hydra-head-active-p
(function).
hydra-head-atime
(reader).
(setf hydra-head-atime)
(writer).
hydra-head-data
(reader).
(setf hydra-head-data)
(writer).
hydra-head-garbage-collected-body-p
(reader).
(setf hydra-head-garbage-collected-body-p)
(writer).
hydra-head-gc-callbacks
(reader).
(setf hydra-head-gc-callbacks)
(writer).
hydra-head-id
(reader).
(setf hydra-head-id)
(writer).
hydra-head-p
(function).
in-active-remote-procedure-p
(function).
in-intercom-session
(macro).
key-value-store
(structure).
key-value-store-hash
(reader).
(setf key-value-store-hash)
(writer).
key-value-store-lock
(reader).
(setf key-value-store-lock)
(writer).
key-value-store-p
(function).
kv-store-read
(function).
(setf kv-store-read)
(function).
make-hydra-body
(function).
make-hydra-head
(function).
make-key-value-store
(function).
make-log-message-string
(function).
make-remote-procedure-lambda-function
(function).
make-session-validation
(function).
maybe-log-request
(macro).
mk-session-validation
(function).
perform-close-request
(function).
perform-intercom-request
(function).
ping-logging
(function).
register-remote-procedure
(function).
remove-hydra-validation
(function).
remove-rid
(function).
request-logging
(function).
response-logging
(function).
retrieve-hydra-validations
(function).
rid-active-p
(function).
s+
(function).
send-current-hhid
(function).
session-validation
(structure).
session-validation-host
(reader).
(setf session-validation-host)
(writer).
session-validation-hydra-body
(reader).
(setf session-validation-hydra-body)
(writer).
session-validation-hydra-id
(reader).
(setf session-validation-hydra-id)
(writer).
session-validation-p
(function).
session-validation-user-agent
(reader).
(setf session-validation-user-agent)
(writer).
start-rid
(function).
store-hydra-validation
(function).
talk
(function).
thread-initial-bindings
(function).
touch
(generic function).
valid-session-p
(function).
with-doublequotes
(macro).
with-hydra-auth-store-lock
(macro).
with-key-value-store-lock
(macro).
with-local-screen-lock
(macro).
Packages are listed by definition order.
intercom
alexandria
.
common-lisp
.
jsown
.
*hydra-body-timeout*
(special variable).
*hydra-head-timeout*
(special variable).
*log-request-stream*
(special variable).
*remote-procedure-context*
(special variable).
activep
(function).
add-screen-gc-callback
(function).
add-session-gc-callback
(function).
auto-end-remote-procedure-p
(function).
(setf auto-end-remote-procedure-p)
(function).
define-remote-procedure
(macro).
handle-talk-request
(function).
message
(function).
remove-screen-gc-callback
(function).
remove-session-gc-callback
(function).
screen-var
(function).
(setf screen-var)
(function).
session-var
(function).
(setf session-var)
(function).
threadable-lambda
(macro).
translate-remote-procedure-name
(function).
with-error-as-fail
(macro).
with-screen-db-lock
(macro).
with-session-db-lock
(macro).
*auto-kill-rid*
(special variable).
*current-thread-start-internal-runtime*
(special variable).
*hydra-auth-lock*
(special variable).
*hydra-auth-store*
(special variable).
*hydra-body*
(special variable).
*hydra-head*
(special variable).
*hydra-head-id*
(special variable).
*log-stream-lock*
(special variable).
*remote-procedures*
(special variable).
*rid*
(special variable).
assert-eql-compatible
(macro).
assert-hydra-body
(macro).
assert-hydra-head
(macro).
assert-hydra-session-validation
(macro).
assert-nonempty-string
(macro).
assert-session
(function).
attach-head
(function).
build-active-authentication
(function).
build-active-hydra-body
(function).
call-remote-procedure
(function).
close-request-logging
(function).
copy-hydra-body
(function).
copy-hydra-head
(function).
copy-key-value-store
(function).
copy-session-validation
(function).
discover-hydra
(function).
discover-hydra-body
(function).
ensure-hhid
(function).
ensure-hydra
(function).
ensure-hydra-head
(function).
esc
(macro).
fetch-and-clear-messages
(function).
gc-hydra-bodies
(function).
gc-hydra-body
(function).
gc-hydra-head
(function).
gc-hydra-heads
(function).
generate-id
(function).
get-remote-procedure
(function).
hash-keys
(function).
hydra-body
(structure).
hydra-body-active-p
(function).
hydra-body-atime
(reader).
(setf hydra-body-atime)
(writer).
hydra-body-data
(reader).
(setf hydra-body-data)
(writer).
hydra-body-garbage-collected-body-p
(reader).
(setf hydra-body-garbage-collected-body-p)
(writer).
hydra-body-gc-callbacks
(reader).
(setf hydra-body-gc-callbacks)
(writer).
hydra-body-heads
(reader).
(setf hydra-body-heads)
(writer).
hydra-body-p
(function).
hydra-head
(structure).
hydra-head-active-p
(function).
hydra-head-atime
(reader).
(setf hydra-head-atime)
(writer).
hydra-head-data
(reader).
(setf hydra-head-data)
(writer).
hydra-head-garbage-collected-body-p
(reader).
(setf hydra-head-garbage-collected-body-p)
(writer).
hydra-head-gc-callbacks
(reader).
(setf hydra-head-gc-callbacks)
(writer).
hydra-head-id
(reader).
(setf hydra-head-id)
(writer).
hydra-head-p
(function).
in-active-remote-procedure-p
(function).
in-intercom-session
(macro).
key-value-store
(structure).
key-value-store-hash
(reader).
(setf key-value-store-hash)
(writer).
key-value-store-lock
(reader).
(setf key-value-store-lock)
(writer).
key-value-store-p
(function).
kv-store-read
(function).
(setf kv-store-read)
(function).
make-hydra-body
(function).
make-hydra-head
(function).
make-key-value-store
(function).
make-log-message-string
(function).
make-remote-procedure-lambda-function
(function).
make-session-validation
(function).
maybe-log-request
(macro).
mk-session-validation
(function).
perform-close-request
(function).
perform-intercom-request
(function).
ping-logging
(function).
register-remote-procedure
(function).
remove-hydra-validation
(function).
remove-rid
(function).
request-logging
(function).
response-logging
(function).
retrieve-hydra-validations
(function).
rid-active-p
(function).
s+
(function).
send-current-hhid
(function).
session-validation
(structure).
session-validation-host
(reader).
(setf session-validation-host)
(writer).
session-validation-hydra-body
(reader).
(setf session-validation-hydra-body)
(writer).
session-validation-hydra-id
(reader).
(setf session-validation-hydra-id)
(writer).
session-validation-p
(function).
session-validation-user-agent
(reader).
(setf session-validation-user-agent)
(writer).
start-rid
(function).
store-hydra-validation
(function).
talk
(function).
thread-initial-bindings
(function).
touch
(generic function).
valid-session-p
(function).
with-doublequotes
(macro).
with-hydra-auth-store-lock
(macro).
with-key-value-store-lock
(macro).
with-local-screen-lock
(macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
the time we have before we assume the session has ended.
the time we have before we assume the head is detached.
when non-nil, this should be a character stream. an s-expression based log is written to the
stream containing the ping-times, the requests and the responses for each user. the format is
as follows:
- ping :: (ping utime hydra-body-id hydra-head-id ip-address)
- request :: (req utime hydra-body-id hydra-head-id request-id request-name arg1..argn)
- responses :: (res utime hydra-body-id hydra-head-id request-id time message-type message-value)
- closes :: (close utime hydra-body-id hydra-head-id request-id)
should contain an alist in which the keywords are special variables and the values are evaluated (in the creating thread) each time a remote procedure is built. this allows you to pass special variables.
defines a remote procedure with <name> as the name to be called and <arguments> as the assumed arguments. if <name> is a symbol with only non- lower-case-p characters, then it is converted to lowercase.
creates a lambda which can be threaded. it locally binds the variables which are needed by intercom.
executes <body> in an environment in which all errors are catched and sent as a message with type "fail" to the user.
executes <body> with a lock on the datastore of hydra-head.
this should be used when the new value is based on previous values in the session.
executes <body> with a lock on the datastore of hydra-body.
this should be used when the new value is based on previous values in the session.
returns non-nil if we are currently in an active remote procedure. alias for in-active-remote-procedure-p.
adds <function> to the list of functions to call on garbage collection of <screen>.
adds <function> to the list of functions to call on garbage collection of <session>.
returns non-nil iff the end of the current remote-procedure indicates that the rid should be killed. setfable place defaults to t.
sets the killing of the remote-procedure to <value>. non-nil indicates that the remote-procedure should be killed (the default), nil indicates the inverse.
handle-talk-request handles a talk request.
splitting this off allows us to handle talking when easy-handlers aren’t in use.
sends a message to the client
removes <function> from the list of functions to call on the garbage collection of <screen>.
removes <function> from the list of functions to call on the garbage collection of <session>.
returns the value of <key> which belongs to <screen>, or nil if it didn’t exist. the second value is non-nil iff <key> was found in <screen>.
sets the value of ,key> which belongs to <screen> to <value>.
returns the value of <key> which belongs to <session>, or nil if it didn’t exist. the second value is non-nil iff <key> was found in <session>.
sets the value of ,key> which belongs to <session> to <value>.
translates the remote procedure name <name> to the remote procedure name as can be called from the javascript world.
when this is set to non-nil in a given thread (which is the default for call-remote-procedure, then the ending of the call to call-remote-procedure signals the end of the rid. you can turn it on with #’auto-end-remote-procedure and turn it off with #’dont-auto-end-remote-procedure.
contains the internal runtime when this RPC call was started.
this lock is used when accessing the hydra-auth-store
a hash-table linking each "hydra" cookie value to the authentication which belongs to it.
contains the hydra-body once we have a hydra-body in the current request
contains the hydra-head once we have one in the current request
represents the screen identifier of the current request
this lock should be held when writing to the log stream.
contains all intercom remote procedures, the keywords being the matched string and the values being the corresponding function.
variable which contains the request id in functions which represent the execution of a remote procedure.
asserts that place is an eql-compatible place.
this means it must be one of:
1. a symbol
2. a character
3. a number
asserts that <place> contains a hydra-body
asserts that <place> contains a hydra-head
asserts that <place> contains a hydra-session
asserts that <place> contains a non-empty string.
executes a hunchentoot request in an environment in which the special local variables are
bound to be special and local.
this contains:
- *hydra-body*
- *hydra-head*
- *hydra-head-id*
executes <body> in an environment where the <log*> function is defined iff *log-request-stream* is non-nil. the <log*> function takes the type of content to log, followed by the content itself by &rest and it splices hydra-body-id hydra-head-id in that list.
makes sure each variable in variables is bound to itself, essentially allowing you to write ,, in a double backtick to get that symbol. handy for gensym.
executes <body> in an environment in which *hydra-auth-store* is locked.
executes body in an environment in which <store> is locked.
executes <body> in a piece of code in which the head’s data is locked
asserts that we’re currently running in an environment which is sane for intercom requests/executions
attaches <hydra-head> to <hydra-body>
builds a new authentication, which identifies hydra-body, and stores it in the necessary structures.
builds a new hydra-body and sets it as the current hydra-body.
calls the remote prodecure with name <name> and <args> as the arguments with <rid> as reference. assumes the special variables *hydra-head* and *hydra-body* exist and respectively contain a hydra-head and a hydra-body.
handles the logging of close requests
discover-hydra returns non-nil iff we had a session-cookie through which we could find a hydra session-validation which is valid for our current session. this function sets up all special variables for the hydra to be happy. it also touches the hydra-body and the relevant hydra-head so we’re active.
returns non-nil iff we had a session-cookie through which we could
find a hydra session-validation which is valid for our current session.
this function sets up all special variables for the hydra-body,
but leaves the hydra-head for another solution to figure out.
returns the hhid if one was given as a get-variable, or creates a new hhid.
does *not* put the hhid on the message stack.
returns (values hhid newp). if newp is t, a message should be sent to the
client (see (send-current-hhid)) so the client knows the hhid.
ensures the hydra is set up. this means that:
- after this function execution:
- *hydra-head* is bound to the hydra’s head
- *hydra-body* is bound to the hydra’s body
- *hydra-auth-store* contains an authentication for continued storage
- after this request:
- the user has a "hydra" cookie which links to this session.
ensures the hydra-head exists and is set in the variable *hydra-head*. assumes *hydra-body* is set. returns the current hydra-head.
fetches and clears the messages in the mailbox
garbage collect the head hydras. this removes the session-validation objects and removes the head heads.
garbage-collects a hydra-body
garbage-collects a hydra-head
detaches the dead heads from <hydra-body>.
we generate an id by taking the universal time and augmenting it by some random number
returns the remote procedure for <name> or nil if the procedure doesn’t exist.
returns a list of all hash-keys in <hash>
returns non-nil iff the <hydra> hasn’t been touched for too long of a time.
data
.
returns non-nil iff the <hydra> hasn’t been touched for too long of a time.
data
.
id
.
returns non-nil if we are currently in a remote procedure with an active rid.
hash
.
lock
.
reads the key from store
sets <key> in <store> to <value>
constructs a log message string for type and the followed arguments.
builds the s-expression representation for the lambda function which can be called for the definition of a remote procedure. this handles the creation of the &key arguments.
constructs a new session-validation object for the current session.
closes the request for the rid.
performs an intercom request as described by <jsown-request>.
handles the logging of the ping request
registers the remote procedure for <name> to be <function>.
removes the session-validation <session-validation> from the known validations.
removes the <rid> from the list of active rids
handles the logging of the new requests
handles the logging of the responses
returns all hydra session-varlidation instance which belong to the given hydra-id
returns non-nil iff <rid> is active for the current user. by use of the variable my-active-rids, the currently active rids can be overridden. !only use when you know what you’re doing!
pretty-prints and concatenates the resulting strings of each arg in <args>.
sends the current hhid to the client by using the correct intercom message. requires that *hydra-head* and *hydra-head-id* are set correctly.
host
.
sets <rid> to be active
stores the hydra session-validation so it can be found back.
calculates the initial bindings for the current thread. this consists of whatever is available in bordeaux-threads:*initial-bindings*, but with what *remote-procedure* contains in front of it (in which the values are evaluated).
validates the session-validation for the current request
touches an object, updating the modification time.
hydra-head
)) ¶hydra-body
)) ¶structure-object
.
(intercom::make-key-value-store)
(get-universal-time)
structure-object
.
(intercom::make-key-value-store)
(get-universal-time)
structure-object
.
string
""
string
""
string
""
(or intercom::hydra-body null)
Jump to: | (
A B C D E F G H I K M P R S T V W |
---|
Jump to: | (
A B C D E F G H I K M P R S T V W |
---|
Jump to: | *
A D G H I L S U |
---|
Jump to: | *
A D G H I L S U |
---|
Jump to: | F H I K P S |
---|
Jump to: | F H I K P S |
---|