view release on metacpan or search on metacpan
lib/Net/Server/PSGI.pm view on Meta::CPAN
$env->{'psgi.input'} = $self->{'server'}->{'client'};
$env->{'psgi.errors'} = $self->{'server'}->{'log_handle'};
$env->{'psgi.multithread'} = 1;
$env->{'psgi.multiprocess'} = 1;
$env->{'psgi.nonblocking'} = 1; # need to make this false if we aren't of a forking type server
$env->{'psgi.streaming'} = 1;
local %ENV;
$self->process_psgi_request($env);
alarm(0);
1;
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Shoutcast/Admin.pm view on Meta::CPAN
}
=item source_connected
Returns true if the stream is currently up (a source is connected and streaming
audio to the server)
=cut
sub source_connected {
view all matches for this distribution
view release on metacpan or search on metacpan
our $VERSION = '0.28';
1;
=head1 NAME
Using Twitter's streaming api.
=head1 SYNOPSIS
use Net::Twitter::Stream;
a twitter account to connect.
JSON format is only supported. Twitter may depreciate XML.
More details at: http://dev.twitter.com/pages/streaming_api
Options
user, pass: required, twitter account user/password
callback: required, a subroutine called on each received tweet
view all matches for this distribution
view release on metacpan or search on metacpan
t/amqp0-8.xml view on Meta::CPAN
<!--
======================================================
== STREAMING
======================================================
-->
work with streaming content
<doc>
The stream class provides methods that support multimedia streaming.
The stream class uses the following semantics: one message is one
packet of data; delivery is unacknowleged and unreliable; the consumer
can specify quality of service parameters that the server can try to
adhere to; lower-priority messages may be discarded in favour of high
priority messages.
t/amqp0-8.xml view on Meta::CPAN
<field name = "consume rate" type = "long">
transfer rate in octets/second
<doc>
Specifies a desired transfer rate in octets per second. This is
usually determined by the application that uses the streaming
data. A value of zero means "no limit", i.e. as rapidly as
possible.
</doc>
<doc name = "rule">
The server MAY ignore the prefetch values and consume rates,
t/amqp0-8.xml view on Meta::CPAN
the queue was declared as private, and ideally, impose no limit
except as defined by available resources.
</doc>
<doc name = "rule">
Streaming applications SHOULD use different channels to select
different streaming resolutions. AMQP makes no provision for
filtering and/or transforming streams except on the basis of
priority-based selective delivery of individual messages.
</doc>
<chassis name = "server" implement = "MUST" />
<response name = "consume-ok" />
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/UpYun.pm view on Meta::CPAN
=item * simple check file exists on remote ,no need to fetch its content,save bandwidth.
=item * display/compare files checksum(MD5) local and remote.
=item * streaming upload to save memory.
=item * useful utility, like tar/untar to/from upyun on fly.
=item * multi operation and performance requests in parallel.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/WebSocket.pm view on Meta::CPAN
Net::WebSocket emphasizes flexibility and lightness rather than the more
monolithic approach in modules like L<Mojolicious>.
Net::WebSocket should support anything
that the WebSocket protocol itself can do, as lightly as possible and without
prejudice as to how you want to do it: extensions, streaming, blocking or
non-blocking I/O, arbitrary HTTP headers, etc. The end result should be a
clean, light implementation that will grow (or shrink!) as your needs
dictate.
=head1 OVERVIEW
lib/Net/WebSocket.pm view on Meta::CPAN
L<permessage-deflate extension|https://tools.ietf.org/html/rfc7692>.
=item * Additional opcodes: 3-7 and 11-15. Youâll need to subclass
L<Net::WebSocket::Frame> for this, and you will likely want to subclass
L<Net::WebSocket::Parser>.
If youâre using the custom classes for streaming, then you can
also subclass L<Net::WebSocket::Streamer>. See each of those modules for
more information on doing this.
B<THIS IS NOT WELL TESTED.> Proceed with caution, and please file bug
reports as needed. (I personally donât know of any applications that
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Wire10.pm view on Meta::CPAN
# Sends a wire protocol ping
sub ping {
my $self = shift;
$self->_check_streaming;
$self->_check_connected;
$self->_reset_command_state;
$self->_reset_timeout($self->{connect_timeout});
return $self->_execute_command(COMMAND_PING, '', undef);
lib/Net/Wire10.pm view on Meta::CPAN
sub _check_connected {
my $self = shift;
$self->_fatal_error("Not connected") unless defined($self->{socket});
}
# Fail if currently connected to a streaming data reader
sub _check_streaming {
my $self = shift;
$self->_vanilla_error("Connection is busy streaming") if $self->{streaming};
}
# Connects to the database server
sub _connect {
my $self = shift;
lib/Net/Wire10.pm view on Meta::CPAN
sub _execute_query {
my $self = shift;
my $sql = shift;
my $wantstream = shift;
$self->_check_streaming;
$self->_check_connected;
$self->_reset_command_state;
$self->_reset_timeout($self->{query_timeout});
$self->{streaming} = 1 if $wantstream;
my $iterator = Net::Wire10::Results->new($self);
$self->{streaming_iterator} = $iterator if $wantstream;
# The protocol is configured to always use UTF-8 during handskake, to
# avoid messing with all the local character sets. Therefore any input
# string needs to be automatically converted if it is not already UTF-8.
utf8::upgrade($sql) if defined($sql) and not utf8::is_utf8($sql);
lib/Net/Wire10.pm view on Meta::CPAN
}
if ($macket->{type} == MACKET_RESULT_SET_HEADER) {
my $pos = MACKET_HEADER_LENGTH;
$self->_parse_result_set_header_macket($macket, \$pos);
$self->_retrieve_column_info($iterator);
$self->_retrieve_results($iterator) unless $self->{streaming};
}
if ($macket->{type} == MACKET_OK) {
$self->_parse_ok_macket($macket, $iterator);
$self->_detach_results($iterator);
}
lib/Net/Wire10.pm view on Meta::CPAN
# Disconnect result set from driver, must only be done after all results have been read
sub _detach_results {
my $self = shift;
my $iterator = shift;
$iterator->{wire}->{streaming_iterator} = undef;
$iterator->{wire}->{streaming} = 0;
$iterator->{wire} = undef;
}
# Reads and interprets OK, saving the number of affected rows,
# the insert id, and the server message. Returns the number of
lib/Net/Wire10.pm view on Meta::CPAN
}
# Resets the command execution status
sub _reset_command_state {
my $self = shift;
# Disconnect streaming iterator.
$self->_detach_results($self->{streaming_iterator}) if defined($self->{streaming_iterator});
# Reset internal column counter.
$self->{no_of_columns} = undef;
# Reset error state.
$self->{error} = undef;
# Reset cancel flag.
lib/Net/Wire10.pm view on Meta::CPAN
# For disconnected result sets, row data could be integrity
# checked during query() to simplify error handling for
# applications.
if (defined($wire)) {
# In streaming mode, fetch a row
return undef unless $wire->_retrieve_row_data($self);
}
# Return unless there is another row available
return undef if scalar(@{$self->{row_data}}) == 0;
lib/Net/Wire10.pm view on Meta::CPAN
sub query {
my $self = shift;
return $self->_execute(0);
}
# Run the prepared statement and return a result object for streaming.
sub stream {
my $self = shift;
return $self->_execute(1);
}
lib/Net/Wire10.pm view on Meta::CPAN
A result set is returned. The obtained result set will be live with the driver. After retrieving the result set, you must traverse all of its rows before you can fire another query.
Use stream() for large result sets, as it has a smaller memory footprint compared to query(). If you want to download data to a disconnected result set, use query().
Note that stream() will lock the driver until the whole result set has been retrieved. To fetch another set of results while streaming to a live result set, create another driver object.
Also note that if you are using MySQL with the default storage engine, MyISAM, the entire table on the server will be locked for the duration of the live result set, that is until all rows have been retrieved.
=head3 prepare
lib/Net/Wire10.pm view on Meta::CPAN
All results are spooled before the call returns.
=head3 stream
Execute the prepared statement using the parameters previously set with set_parameter().
As soon as the initial metadata arrives from the database server, the call returns, and the results can be traversed in a streaming fashion.
=head2 Features in the I<Net::Wire10::Results> iterator
A Net::Wire10::Results object is returned when calling query() or stream(). Depending on which was used to execute the SQL, either a disconnected result set or a live (streaming) result set is returned.
=head3 next_array
The next_array() method returns a whole row, with individual field values packed into an array.
C<undef> is returned once all rows has been extracted.
lib/Net/Wire10.pm view on Meta::CPAN
After calling next_hash(), the row has been consumed. There is currently no way to rewind and re-read a row, even for a disconnected result set.
=head3 spool
Reads the remaining rows of the result set, in effect turning a streaming result set into a disconnected result set.
=head3 flush
Reads the remaining rows of the result set and discards them. When done on a live result set, this frees the driver for use.
lib/Net/Wire10.pm view on Meta::CPAN
my $selected = $wire->get_no_of_selected_rows;
After consuming a row, the number of available rows will decrease, and get_no_of_selected_rows() will return one less.
Supported only for disconnected result sets, live/streaming result sets are unaware of the total number of records. A streaming result set can be turned into a disconnected result set using spool(), after which the number of available rows becomes k...
=head3 get_insert_id
MySQL and Drizzle has the ability to choose unique key values automatically, by enabling auto_increment for a column. When this happens, the newly assigned id value for the last inserted row is stored in this attribute.
=head3 get_warning_count
After a query, this returns the number of warnings generated on the server. If the query is streaming to a live result set, an additional warning count is available after the last row of data has been read.
=head2 Features in the I<Net::Wire10::Error> object
After an error has occurred, call $wire->C<get_error_info()> to retrieve an Error object containing details of the problem.
lib/Net/Wire10.pm view on Meta::CPAN
There is also a purely SQL-driven interface to prepared statements, using the PREPARE, EXECUTE and DEALLOCATE PREPARE commands. The SQL-driven interface does not have the same performance benefits as the protocol-level one does. It can however be u...
There is also a client-side prepared statement interface in the driver, which it is highly recommended to use.
=head3 High-granularity streaming
Streaming data along the way as it is consumed or delivered by the client application can lead to dramatical decreases in memory usage.
Streaming outgoing data can be accomplished with server-side prepared statements, because the wire protocol allows prepared statement parameters to be sent one at a time, and even in chunks. Chunking data presumably allows you to interleave data to ...
The driver API currently allows client applications to stream incoming data one row at a time. The highest supported granularity for streaming is one whole row at a time. Streaming at a higher granularity and interleaving chunks of incoming data is...
Streaming incoming data in a row-by-row fashion is also known in some drivers as "use_result mode".
=head3 Server-side cursors
Cursors provide a way of keeping open, navigating and optionally modifying a result set on the server, rather than having to transfer the entire result set to the client.
MySQL Server supports only a particular class of cursors known as read-only, forward-only cursors. As the name implies, this kind of cursor cannot be navigated (also called "scrolled") or modified.
The semantics are exactly the same as when streaming incoming data with the L<stream>() call. With cursors however, the server automatically creates a temporary table behind the scenes from which the data is read, thereby always using extra resource...
There is also a purely SQL-driven interface to cursors, which can be useful inside stored procedures.
Server-side cursors are part of the prepared statement protocol features (see above), and are therefore currently not supported.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Net/Inet.pm view on Meta::CPAN
sslp 1750
swiftnet 1751
lofr-lm 1752
translogic-lm 1753
oracle-em2 1754
ms-streaming 1755
capfast-lmd 1756
cnhrp 1757
tftp-mcast 1758
spss-lm 1759
www-ldap-gw 1760
lib/Net/Inet.pm view on Meta::CPAN
sslp 1750
swiftnet 1751
lofr-lm 1752
translogic-lm 1753
oracle-em2 1754
ms-streaming 1755
capfast-lmd 1756
cnhrp 1757
tftp-mcast 1758
spss-lm 1759
www-ldap-gw 1760
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ODG/Record/Discussion.pod view on Meta::CPAN
=head1 DISCUSSION
This document maintains some thoughts of Record Iterators and Moose.
ODG::Record is designed for efficient streaming, i.e. accessing
one-record-at-a-time. For conventional record iterators, a new row
object is created for each record, slots are initialized, data are
filled and types are checked. Not all of this is desirable.
=head1 Object Recycling
view all matches for this distribution
view release on metacpan or search on metacpan
0.05 2012-10-15
- OX::Request->mapping should return a hashref, not a hash (minor
back-compat break)
0.04 2012-09-29
- support streaming responses
0.03 2012-09-28
- fix tests on windows (path issue)
- fix Counter-Improved example not having uri_for available
(yet_another_anonymo)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ObjectDBI.pm view on Meta::CPAN
package ObjectDBI::Cursor;
=head1 CURSORS
Cursors are there to obtain lists of objects in a 'streaming' (as opposed
to 'buffered') fashion. When the list of objects is (potentially) too long
to retrieve all at once, you'd use a cursor and iterate through it.
=head2 B<my $cursor = $objectdbi-E<gt>cursor([query], [type]);>
view all matches for this distribution
view release on metacpan or search on metacpan
ovcb_tell
};
/* Allow multiple instances of the decoder object. Stuff each filehandle into (void*)stream */
typedef struct {
int is_streaming;
int bytes_streamed;
int last_bitstream;
PerlIO *stream;
} ocvb_datasource;
static int ovcb_seek(void *vdatasource, ogg_int64_t offset, int whence) {
ocvb_datasource *datasource = vdatasource;
if (datasource->is_streaming) {
return -1;
}
/* For some reason PerlIO_seek fails miserably here. < 5.8.1 works */
/* return PerlIO_seek(datasource->stream, offset, whence); */
static long ovcb_tell(void *vdatasource) {
ocvb_datasource *datasource = vdatasource;
if (datasource->is_streaming) {
return datasource->bytes_streamed;
}
return PerlIO_tell(datasource->stream);
}
safefree(vf);
printf("failed on open: [%d] - [%s]\n", errno, strerror(errno));
XSRETURN_UNDEF;
}
datasource->is_streaming = 0;
} else if (SvOK(path)) {
/* Did we get a Glob, or a IO::Socket subclass?
*
* XXX This should really be a class method so the caller
* can tell us if it's streaming or not. But how to do this on
* a per object basis without changing open()s arugments. That
* may be the easiest/only way. XXX
*
*/
if (sv_isobject(path) && sv_derived_from(path, "IO::Socket")) {
datasource->is_streaming = 1;
} else {
datasource->is_streaming = 0;
}
/* dereference and get the SV* that contains the Magic & FH,
* then pull the fd from the PerlIO object */
datasource->stream = IoIFP(GvIOp(SvRV(path)));
if (ix) {
/* empty */
}
/* See http://www.xiph.org/ogg/vorbis/doc/vorbisfile/ov_read.html for
* a description of the bitstream parameter. This allows streaming
* without a hack like icy-metaint */
cur_bitstream = (int) SvIV(*(my_hv_fetch(self, "BSTREAM")));
old_bitstream = cur_bitstream;
/* When we get a new bitstream, re-read the comment fields */
view all matches for this distribution
view release on metacpan or search on metacpan
LibVorbis.xs view on Meta::CPAN
ovcb_tell
};
/* Allow multiple instances of the decoder object. Stuff each filehandle into (void*)stream */
typedef struct {
int is_streaming;
int bytes_streamed;
int last_bitstream;
PerlIO *stream;
} ocvb_datasource;
LibVorbis.xs view on Meta::CPAN
static int ovcb_seek(void *vdatasource, ogg_int64_t offset, int whence) {
ocvb_datasource *datasource = vdatasource;
if (datasource->is_streaming) {
return -1;
}
/* For some reason PerlIO_seek fails miserably here. < 5.8.1 works */
/* return PerlIO_seek(datasource->stream, offset, whence); */
LibVorbis.xs view on Meta::CPAN
static long ovcb_tell(void *vdatasource) {
ocvb_datasource *datasource = vdatasource;
if (datasource->is_streaming) {
return datasource->bytes_streamed;
}
return PerlIO_tell(datasource->stream);
}
LibVorbis.xs view on Meta::CPAN
safefree(vf);
fprintf(stderr, "failed on open: [%d] - [%s]\n", errno, strerror(errno));
XSRETURN_UNDEF;
}
datasource->is_streaming = 0;
} else if (SvOK(path)) {
/* Did we get a Glob, or a IO::Socket subclass? */
if (sv_isobject(path) && sv_derived_from(path, "IO::Socket")) {
datasource->is_streaming = 1;
} else {
datasource->is_streaming = 0;
}
/* dereference and get the SV* that contains the Magic & FH,
* then pull the fd from the PerlIO object */
datasource->stream = IoIFP(GvIOp(SvRV(path)));
LibVorbis.xs view on Meta::CPAN
safefree(vf);
printf("failed on open: [%d] - [%s]\n", errno, strerror(errno));
XSRETURN_UNDEF;
}
datasource->is_streaming = 0;
} else if (SvOK(path)) {
/* Did we get a Glob, or a IO::Socket subclass? */
if (sv_isobject(path) && sv_derived_from(path, "IO::Socket")) {
datasource->is_streaming = 1;
} else {
datasource->is_streaming = 0;
}
/* dereference and get the SV* that contains the Magic & FH,
* then pull the fd from the PerlIO object */
datasource->stream = IoIFP(GvIOp(SvRV(path)));
view all matches for this distribution
view release on metacpan or search on metacpan
- NEW: bulk_discovery() supports passing an OQL along with input filename
- New procs added: top, fieldcount, filter, expand, discovery, pivots, subnet, output, flatten
- New: various state handling functions
- New: systematically order results by field name
- BUGFIX: onyphe to strip "@category":"none" in OPP callbacks
- BUGFIX: export, bulk and all streaming APIs were returning duplicates at output
- Bugfix: discovery proc to strip "@category":"none" results
- Update: output proc to render ordered results
- Remove: app.extract.domain from pivots proc as too easy to do false positive
4.00 Tue 7 Mar 16:03:36 CET 2023
view all matches for this distribution
view release on metacpan or search on metacpan
near-useless Schema.pod that we used to have.
0.16 2025-04-06
- Audio API Updates: The audio text-to-speech model is updated to
gpt-4o-mini-tts, and the audio transcription model is updated to
gpt-4o-transcribe, with the addition of a streaming option for the
transcription api.
- Chat Completions Enhancements: Introduces new features for the Chat
Completions API, including the ability to list, retrieve, update, and delete
chat completions. Support for metadata filtering is added, and the
documentation clarifies parameter support across different models. Â
view all matches for this distribution
view release on metacpan or search on metacpan
lib/OpenAPI/PerlGenerator/Template/Mojo.pm view on Meta::CPAN
% } else {
<%= $argname %>
% }
__INFLATED_RESPONSE__
$template{streaming_response} = <<'__STREAMING_RESPONSE__';
use Future::Queue;
my $res = Future::Queue->new( prototype => 'Future::Mojo' );
our @store; # we should use ->retain() instead
push @store, $r1->then( sub( $tx ) {
my $resp = $tx->res;
# Should we validate using OpenAPI::Modern here?!
%# Should this be its own subroutine instead?!
% for my $code (sort keys $elt->{responses}->%*) { # response code s
% my $info = $elt->{responses}->{ $code };
%# XXX if streaming, we need to handle a non-streaming error response!
<%= elsif_chain($name) %>( $resp->code <%= openapi_http_code_match( $code ) %> ) {
% if( $info->{description} =~ /\S/ ) {
# <%= single_line( $info->{description} ) %>
% }
% # Check the content type
lib/OpenAPI/PerlGenerator/Template/Mojo.pm view on Meta::CPAN
%# These handlers for content types should come from templates? Or maybe
%# from a subroutine?!
% if( $ct eq 'application/json' ) {
my $payload = $resp->json();
% } elsif( $ct eq 'application/x-ndjson' ) {
# code missing to hack up ndjson into hashes for a non-streaming response
my $payload = $resp->body();
% } else {
my $payload = $resp->body();
% }
return Future::Mojo->done(
lib/OpenAPI/PerlGenerator/Template/Mojo.pm view on Meta::CPAN
=head1 METHODS
% for my $method ($methods->@*) {
% my $elt = $method->{elt};
% my $is_streaming = exists $elt->{responses}->{200}
% && $elt->{responses}->{200}->{content}
% && [keys $elt->{responses}->{200}->{content}->%*]->[0] eq 'application/x-ndjson'
% ;
%
%# Sort the parameters according to where they go
lib/OpenAPI/PerlGenerator/Template/Mojo.pm view on Meta::CPAN
% }
%
=head2 C<< <%= $method->{name} %> >>
%# Generate the example invocation
% if( $is_streaming ) {
use Future::Utils 'repeat';
my $responses = $client-><%= $method->{name} %>();
repeat {
my ($res) = $responses->shift;
if( $res ) {
lib/OpenAPI/PerlGenerator/Template/Mojo.pm view on Meta::CPAN
if( $results->{error}) {
say $results;
say $tx->req->to_string;
};
%# We want to handle both here, streaming (ndjson) and plain responses
%# Plain responses are easy, but for streamed, we want to register an ->on('progress')
%# handler instead of the plain part completely. In the ->on('progress') part,
%# we still run the handler, so maybe that is the same ?!
my $r1 = Future::Mojo->new();
% if( $is_streaming ) {
<%= include('streaming_response', {
name => $method->{name},
elt => $elt,
prefix => $prefix,
}); =%>
% } else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/OpenTok/API.pm view on Meta::CPAN
p2p.preference (String) . Whether the session's streams will be transmitted directly between peers. You can set the following possible values:
"disabled" (the default) . The session's streams will all be relayed using the OpenTok servers. More than two clients can connect to the session.
"enabled" . The session will attempt to transmit streams directly between clients. If peer-to-peer streaming fails (either when streams are
initially published or during the course of a session), the session falls back to using the OpenTok servers for relaying streams.
(Peer-to-peer streaming uses UDP, which may be blocked by a firewall.) For a session created with peer-to-peer streaming enabled,
only two clients can connect to the session at a time. If an additional client attempts to connect,
the TB object on the client dispatches an exception event.
By removing the server, peer-to-peer streaming decreases latency and improves quality.
Note that the properties object previously included settings for multiplexing and server-side echo suppression.
However, these features were deleted in OpenTok v0.91.48. (Server-side echo suppression was replaced with the
acoustic echo cancellation feature added in OpenTok v0.91.18.)
view all matches for this distribution
view release on metacpan or search on metacpan
as the result might not get saved in the database, so you better commit
everything before flushing and then just continue output (use GET or POST
to create new links after this).
Flushing does not yet harmonize with output stylesheet processing, for the
semi-obvious reason that PApp::XSLT does not support streaming operation.
BUGS: No links that have been output so far can be followed until the
document is finished, because the neccessary information will not reach
the disk until the document.... is finished ;)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PEF/Front/WebSocket.pm view on Meta::CPAN
=over
=item *
C<psgi.streaming> environment is true.
=item *
C<psgi.nonblocking> environment is true.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PEF/Front/Model.pm view on Meta::CPAN
C<answer_no_nls> is not present or false then this message
will be automatically localized.
When calling type is C</get> or C</submit> then value of this
key can be open file handle or code reference. If value of this
key is code reference then it is "streaming function".
See L<PSGI/"Delayed Response and Streaming Body">.
=item B<answer_args>
Array of arguments to the message.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POD2/RU/PSGI.pod view on Meta::CPAN
C<psgi.nonblocking>: ÐÑлево знаÑение, ÑодеÑжаÑее true, еÑли ÑеÑÐ²ÐµÑ Ð²ÑзÑваеÑ
пÑиложение в неблокиÑÑÑÑем ÑобÑÑийном Ñикле.
=item *
C<psgi.streaming>: ÐÑлево знаÑение, Ñавное true, еÑли ÑеÑÐ²ÐµÑ Ð¾Ð¶Ð¸Ð´Ð°ÐµÑ
оÑложенного оÑвеÑа в ÑÑиле callback и поÑокового пиÑÑÑего обÑекÑа.
=back
СеÑÐ²ÐµÑ Ð¸Ð»Ð¸ пÑиложение Ð¼Ð¾Ð¶ÐµÑ Ñакже ÑоÑ
ÑанÑÑÑ Ñвои даннÑе в пеÑеменнÑÑ
lib/POD2/RU/PSGI.pod view on Meta::CPAN
=head2 ÐÑложеннÑй ÐÑÐ²ÐµÑ Ð¸ ÐоÑоковое Тело оÑвеÑа
The PSGI interface allows applications and servers to provide a
callback-style response instead of the three-element array
reference. This allows for a delayed response and a streaming body
(server push).
ÐнÑеÑÑÐµÐ¹Ñ PSGI позволÑÐµÑ Ð¿ÑиложениÑм и ÑеÑвеÑам пÑедоÑÑавлÑÑÑ Ð¾ÑÐ²ÐµÑ Ð² виде
вÑзÑваемой ÑÑнкÑии вмеÑÑо ÑÑÑлки на ÑÑÑÑ
ÑлеменÑнÑй маÑÑив. ÐÑо позволÑеÑ
возвÑаÑаÑÑ Ð¾ÑложеннÑе оÑвеÑÑ Ð¸ поÑоковое Ñело оÑвеÑа (server push).
PSGI ÑеÑвеÑам B<СÐÐÐУÐТ> ÑеализовÑваÑÑ ÑÑÐ¾Ñ Ð¸Ð½ÑеÑÑейÑ, и пеÑеменнаÑ
C<psgi.streaming> должна бÑÑÑ Ñавна true в ÑакиÑ
ÑеÑвеÑаÑ
.
ЧÑÐ¾Ð±Ñ ÑазÑеÑиÑÑ Ð¾ÑложеннÑй оÑвеÑ, пÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ B<СÐÐÐУÐТ> возвÑаÑаÑÑ Ð²ÑзÑваемÑÑ
ÑÑнкÑÐ¸Ñ Ð² каÑеÑÑве оÑвеÑа. ÐÑиложение B<ÐÐÐÐТ> пÑовеÑÑÑÑ, ÑÑо пеÑеменнаÑ
C<psgi.streaming> Ñавна true, и возвÑаÑаÑÑÑÑ Ðº непоÑÑедÑÑÐ²ÐµÐ½Ð½Ð¾Ð¼Ñ Ð¾ÑвеÑÑ, еÑли
ÑÑо не Ñак.
This callback will be called with I<another> subroutine reference (referred to
as the I<responder> from now on) as its only argument. The I<responder>
should in turn be called with the standard three element array reference
lib/POD2/RU/PSGI.pod view on Meta::CPAN
Added optional PSGI keys as extensions: C<psgix.logger> and C<psgix.session>.
=item *
C<psgi.streaming> B<SHOULD> be implemented by PSGI servers, rather than B<MAY>.
=item *
PSGI keys C<psgi.run_once>, C<psgi.nonblocking> and C<psgi.streaming>
B<MUST> be set by PSGI servers.
=item *
Removed C<poll_cb> from writer methods.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Amazon/S3.pm view on Meta::CPAN
$params{libxml} = XML::LibXML->new;
my $self = bless \%params, $class;
# A non-streaming HTTP client for most requests
POE::Component::Client::HTTP->spawn(
Agent => 'POE-Component-Amazon-S3/' . $VERSION,
Alias => 'ua',
Timeout => 30,
);
# A streaming HTTP client for downloads
POE::Component::Client::HTTP->spawn(
Agent => 'POE-Component-Amazon-S3/' . $VERSION,
Alias => 'ua-streaming',
Timeout => 30,
Streaming => $BLOCK_SIZE,
);
POE::Session->create(
lib/POE/Component/Amazon/S3.pm view on Meta::CPAN
sub shutdown {
my ( $kernel, $self ) = @_[ KERNEL, OBJECT ];
# Shut down our HTTP clients
$kernel->post( ua => 'shutdown' );
$kernel->post( 'ua-streaming' => 'shutdown' );
$kernel->alias_remove( $self->{alias} || 'amazon-s3' );
}
### Bucket methods
lib/POE/Component/Amazon/S3.pm view on Meta::CPAN
event => $event,
file => $file,
pass => $conf->{pass} || [],
};
$kernel->post( 'ua-streaming' => request => get_key_done => $request, $pass );
}
sub get_key_done {
my ( $kernel, $self, $req, $res ) = @_[ KERNEL, OBJECT, ARG0, ARG1 ];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/BlogCloud.pm view on Meta::CPAN
1;
__END__
=head1 NAME
POE::Component::BlogCloud - Client interface to blo.gs streaming cloud server
=head1 SYNOPSIS
use POE qw( Component::BlogCloud );
POE::Component::BlogCloud->spawn(
lib/POE/Component/BlogCloud.pm view on Meta::CPAN
);
=head1 DESCRIPTION
I<POE::Component::BlogCloud> is a client interface to the I<blo.gs>
streaming cloud server, described at I<http://blo.gs/cloud.php>. It's
built using the L<POE> framework for Perl, allowing you to build an
event-based application that receives weblog updates, then acts upon them.
=head1 USAGE
lib/POE/Component/BlogCloud.pm view on Meta::CPAN
=over 4
=item * ReceivedUpdate
The callback to execute when an update from the streaming server is
received. ARG0 contains a I<POE::Component::BlogCloud::Update> that
represents the update information.
This argument is required.
=item * AutoReconnect
If the client is disconnected from the streaming server because of an error,
it can be told to automatically try to reconnect by setting I<AutoReconnect>
to C<1>.
This argument is optional, and if not specified defaults to C<0>, meaning
that the client will not automatically reconnect.
=item * RemoteAddress
The address of the streaming server to connect to.
This argument is optional, and if not specified defaults to C<ping.blo.gs>.
=item * RemotePort
The port where the streaming server is running.
This argument is optional, and if not specified defaults to C<9999>.
=back
=head1 CAVEATS
The specification for the streaming server indicates that gzip compression
will be turned on at some point, at which point an update to this module
will be needed.
In addition, the blo.gs server does sometimes seem to get "stuck" and stop
sending updates, which will be indicated by the client hanging waiting
view all matches for this distribution
view release on metacpan or search on metacpan
my %stat = (
':-)' => 'Normal operation, low/no jitter',
':-|' => 'Normal operation, considerable jitter',
':-/' => 'Read drift',
':-P' => 'Unreported loss of streaming in atomic read operation',
'8-|' => 'Finding read problems at same point during reread; hard to correct',
':-0' => 'SCSI/ATAPI transport error',
':-(' => 'Scratch detected',
';-(' => 'Gave up trying to perform a correction',
'8-X' => 'Aborted (as per -X) due to a scratch/skip',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Client/HTTP.pm view on Meta::CPAN
chunks (of OCTETS octets each) rather than combine the entire content
into a single HTTP::Response object.
By default, Client::HTTP reads the entire content for a response into
memory before returning an HTTP::Response object. This is obviously
bad for applications like streaming MP3 clients, because they often
fetch songs that never end. Yes, they go on and on, my friend.
When C<Streaming> is set to nonzero, however, the response handler
receives chunks of up to OCTETS octets apiece. The response handler
accepts slightly different parameters in this case. ARG0 is also an
HTTP::Response object but it does not contain response content,
and ARG1 contains a a chunk of raw response
content, or undef if the stream has ended.
sub streaming_response_handler {
my $response_packet = $_[ARG1];
my ($response, $data) = @$response_packet;
print SAVED_STREAM $data if defined $data;
}
lib/POE/Component/Client/HTTP.pm view on Meta::CPAN
=head2 cancel
Cancel a specific HTTP request. Requires a reference to the original
request (blessed or stringified) so it knows which one to cancel. See
L<progress handler> below for notes on canceling streaming requests.
To cancel a request based on its blessed HTTP::Request object:
$kernel->post( component => cancel => $http_request );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Client/Icecast.pm view on Meta::CPAN
POE::Kernel->run;
=head1 DESCRIPTION
The module is a non-blocking client to Icecast streaming multimedia server for getting stream tags.
See L<http://www.icecast.org/>.
POE::Component::Client::Icecast is based on L<POE::Component::Client::TCP>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Curl/Multi.pm view on Meta::CPAN
return;
}
=head1 STREAMING
This component does not (yet) support L<POE::Component::Client::HTTP>'s streaming options.
=head1 CLIENT HEADERS
POE::Component::Curl::Multi sets its own response headers with
additional information. All of its headers begin with "X-PCCH".
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/FastCGI.pm view on Meta::CPAN
$kernel->post($heap->{Session}, $run->[1],$request, $run->[0]);
}
if($request->{_res}) {
# Streaming support
if($request->{_res}->streaming) {
push @{$heap->{toclose}->{$wheel_id}}, $request->{_res};
} else {
# Send and break circular ref
$request->{_res}->send if exists $request->{_res}->{client};
$request->{_res} = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Server/Bayeux/Request.pm view on Meta::CPAN
if ($self->delay) {
$poe_kernel->post($heap->{manager}, 'delay_request', $self->id, $self->delay);
$self->delay(0);
$self->is_complete(0);
$self->http_response->streaming(1);
}
else {
$self->complete();
}
}
lib/POE/Component/Server/Bayeux/Request.pm view on Meta::CPAN
sub complete {
my ($self) = @_;
$self->form_response( @{ $self->responses } );
$self->is_complete(1);
if ($self->http_response->streaming) {
$self->http_response->send( $self->http_response );
$self->http_response->close();
}
# Ensure no KeepAlive
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Server/TCP.pm view on Meta::CPAN
C<ClientFlushed> exposes POE::Wheel::ReadWrite's C<FlushedEvent> as a
callback. It is called whenever the client's output buffer has been
fully flushed to the client socket. At this point it's safe to shut
down the socket without losing data.
C<ClientFlushed> is useful for streaming servers, where a "flushed"
event signals the need to send more data.
ClientFlushed => sub {
my $data_source = $_[HEAP]{file_handle};
my $read_count = sysread($data_source, my $buffer = "", 65536);
view all matches for this distribution