This is the sse-demo Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:24:42 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
sse-demo
Use sse-server + a web service to serve SSE events to a browser.
Dave Tenny
MIT
0.1.0
sse-server
(system).
hunchentoot
(system).
easy-routes
(system).
flexi-streams
(system).
sse-server
(system).
demo.lisp
(file).
sse-server
sse-server implements support for the sender side of Server Side Events
Dave Tenny
MIT
0.1.0
cl-ppcre
(system).
trivial-escapes
(system).
server.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
sse-demo/demo.lisp
sse-demo
(system).
start-server
(function).
stop-server
(function).
*http-server*
(special variable).
*utf-8*
(special variable).
events
(function).
root
(function).
sse
(function).
sse-server/server.lisp
sse-server
(system).
send-comment!
(function).
send-event!
(function).
send-field!
(function).
string->sse-data
(function).
Packages are listed by definition order.
sse-server
Functions to send SSE event data to a stream.
‘send-event!‘ sends a fully formed and blank-line terminated event.
‘send-comment‘ sends a comment, and may be generally useful before sending an event, or
for debugging
common-lisp
.
send-comment!
(function).
send-event!
(function).
send-field!
(function).
string->sse-data
(function).
sse-demo
Serves up a web page that will emit events to an
EventSource enabled browser (which is most browsers that aren’t provided by Microsoft).
common-lisp
.
start-server
(function).
stop-server
(function).
*http-server*
(special variable).
*utf-8*
(special variable).
events
(function).
root
(function).
sse
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Write string to the output stream as an SSE comment (which start with ’:’). If the string embeds newlines, send it as multiple comment lines.
Write event data to an output stream according to the SSE protocol requirements.
Arguments:
ostream - An output stream to which the event will be written.
;; Specially defined EventSource field names (per the spec)
;; These values are sent with field names matching the parameter name.
event - String naming the event-type.
Note that this has nothing to do with lisp types.
TBD: The spec will allow an event to consist only of data
so not clear this is in our best interest requiring an event (type) property.
data - String data to be sent.
id - Optional integer/string sequence value for client lastEventID use.
retry - Optional integer/string specifying millisconds for the event stream’s reconnect time.
Frankly I’m not sure about how this works other than it must be taken by the client
and will be ignored if it can’t be parsed as an integer.
;; Optional/alternative user defined field names
fields - Optional alist of optional fields to be written as part of the event.
Alist keys represent the (string) field names, and values should be strings.
It is probably an error to have a field nameed ’event-type’.
No values should end in newlines, those are handled
by this function (but a :data value may embedded newlines).
Return value N/A. Signal error if there are any problems writing to ostream.
Start the web service listening on the indicated port.
Write data to ostream as lines of the form ’field-name: str’.
If str contains newlines, split it into pieces and write each line as a ’field-name: str’.
Given a string containing logical newlines, generate a list of substrings for each line.
Note that empty lines are not returned, e.g.:
#"abc\n", "abc" result in one line (note #" readtable dispatch for c-style escapes).
#"\n", and "" result zero lines.
#"\n\n" results in zero lines.
CR, LF, and CRLF are treated as line separators.
Jump to: | E F R S |
---|
Jump to: | E F R S |
---|
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Jump to: | D F P S |
---|
Jump to: | D F P S |
---|