Name
do_push
Synopsis
do_push (params
)
Implements a server push operation, which updates a page at specific intervals. Parameters are:
-delay =>
n
Specifies the number of seconds,
n
, to wait before the next call to the page-drawing subroutine.-last_page =>
\&
sublast
Runs the subroutine
sublast
to draw the last page update of a server push operation. The-last_page
routine is invoked when the-next_page
routine returns false. A reference to a subroutine glob should be provided for this parameter, but the name of the subroutine is also acceptable.-next_page =>
\&
sub
sub
is the name of the subroutine responsible for redrawing the page and counting the number of iterations (if you want repeated updating). Thedo_push
routine ends whensub
returns false (or when the-last_page
subroutine is invoked). A reference to a subroutine glob should be provided for this parameter, but the name of the subroutine is also acceptable.-type =
string
Specifies the content type of the pushed data. The default value is
text/html
.
Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.