Skip to content

Commit

Permalink
Update documentation and manpages accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Faulet committed Jan 6, 2012
1 parent d09ed3d commit 3dee1a5
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 10 deletions.
23 changes: 19 additions & 4 deletions doc/yaws.tex
Expand Up @@ -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
Expand All @@ -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.

Expand Down Expand Up @@ -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}

Expand Down
32 changes: 26 additions & 6 deletions man/yaws_api.5
Expand Up @@ -175,7 +175,7 @@ a URL to ourselves.
port_str %% "" | ":<int>" - the optional port part
%% to append to the url
}).
.nf
.fi


.TP
Expand Down Expand Up @@ -577,7 +577,7 @@ Body = EHTML


For example, \fI{p, [], "Howdy"}\fR expands into
"<p>Howdy</p> and
"<p>Howdy</p>" and

\fI
.nf
Expand Down Expand Up @@ -625,6 +625,25 @@ 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.

.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
Expand Down Expand Up @@ -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.



Expand Down

0 comments on commit 3dee1a5

Please sign in to comment.