Skip to content
Browse files

Update documentation and manpages accordingly

  • Loading branch information...
1 parent d09ed3d commit 3dee1a50c93b15d9341995ad02f2a09e0db4b462 @capflam capflam committed
Showing with 45 additions and 10 deletions.
  1. +19 −4 doc/yaws.tex
  2. +26 −6 man/yaws_api.5
View
23 doc/yaws.tex
@@ -1610,6 +1610,12 @@ \section{All out/1 return values}
data in one go. (Typically if a file is very large or if data
arrives from back end servers on the network.)
+\item \verb+{streamcontent_with_timeout, MimeType, FirstChunk, Timeout}+ Similar
+ to above, but with an explicit timeout. The deafult timeout is 30 secs. I.e if
+ the application fails to deliver data to the Yaws process, the streaming will
+ stop. This is often not the desired behaviour in Comet/Ajax applications. It's
+ possible to provide 'infinity' as timeout.
+
\item \verb+{streamcontent_from_pid, MimeType, Pid}+ This return value
is similar to the \verb+streamcontent+ return value above. However
it makes it possible to stream data to the client directly from an
@@ -1618,6 +1624,13 @@ \section{All out/1 return values}
example, and for applications wanting to avoid buffering data or
avoid HTTP chunked mode transfer for streamed data.
+\item \verb+{streamcontent_with_size, Sz, MimeType, Pid}+ This return value is
+ similar to the \verb+streamcontent+ return value above. However it makes it
+ possible to stream data to the client by setting the content length of the
+ response. As the opposite of other ways to stream data, in this case, the
+ response is not chunked encoded.
+
+
\item \verb+{header, H}+ Accumulates a HTTP header. Used by for
example the \verb+yaws_api:setcookie/2-6+ function.
@@ -1667,10 +1680,12 @@ \section{All out/1 return values}
\verb+CallbackModule+ as a WebSockets Protocol handler for traffic
on the client socket. See chapter \ref{websockets} for more details.
-\item \verb+[ListOfValues]+ It is possible to return a list of the
- above defined return values. Any occurrence of
- \verb+stream_content+, \verb+get_more+, or \verb+page+ in this list
- is legal only if it's in the last position of the list.
+\item \verb+[ListOfValues]+ It is possible to return a list of the above defined
+ return values. Any occurrence of \verb+streamcontent+,
+ \verb+streamcontent_with_timeout+, \verb+streamcontent_with_size+,
+ \verb+streamcontent_from_pid+, \verb+get_more+, \verb+page+ or \verb+break+ in
+ this list is legal only if it is the last position of the list. If not,
+ remaining values in the list are ignored.
\end{itemize}
View
32 man/yaws_api.5
@@ -175,7 +175,7 @@ a URL to ourselves.
port_str %% "" | ":<int>" - the optional port part
%% to append to the url
}).
-.nf
+.fi
.TP
@@ -577,7 +577,7 @@ Body = EHTML
For example, \fI{p, [], "Howdy"}\fR expands into
-"<p>Howdy</p> and
+"<p>Howdy</p>" and
\fI
.nf
@@ -626,6 +626,25 @@ desired behaviour in Comet/Ajax applications. It's possible to
provide 'infinity' as timeout.
.TP
+\fB{streamcontent_from_pid, MimeType, Pid}\fR
+This return value is similar to the \fIstreamcontent\fR return value above.
+
+However it makes it possible to stream data to the client directly from an
+application process to the socket. This approach can be useful for applications
+that employ long-polling (Comet) techniques, for example, and for applications
+wanting to avoid buffering data or avoid HTTP chunked mode transfer for streamed
+data.
+
+.TP
+\fB{streamcontent_with_size, Sz, MimeType, FirstChunk}\fR
+This return value is similar to the \fIstreamcontent\fR return value above.
+
+However it makes it possible to stream data to the client by setting the content
+length of the response. As the opposite of other ways to stream data, in this
+case, the response is not chunked encoded.
+
+
+.TP
\fB{header, H}\fR
Accumulates a HTTP header. The trailing CRNL which is supposed
to end all HTTP headers must NOT be added. It is added by the server.
@@ -760,10 +779,11 @@ occured inline.
.TP
\fB[ListOfValues]\fR
-It is possible to return a deep list of the above defined
-return values. Any occurrence of \fIstream_content\fR, \fIget_more\fR
-or \fIpage\fR in this list is legal only if it is the last position of
-the list.
+It is possible to return a deep list of the above defined return values. Any
+occurrence of \fIstreamcontent\fR, \fIstreamcontent_with_timeout\fR,
+\fIstreamcontent_with_size\fR, \fIstreamcontent_from_pid\fR, \fIget_more\fR,
+\fIpage\fR or \fIbreak\fR in this list is legal only if it is the last position
+of the list. If not, remaining values in the list are ignored.

0 comments on commit 3dee1a5

Please sign in to comment.
Something went wrong with that request. Please try again.