view release on metacpan or search on metacpan
lib/POE/Component/Server/HTTP.pm view on Meta::CPAN
}
}
next;
}
elsif ($state eq 'Cleanup') {
if (not $response->is_error and $response->streaming()) {
$_[HEAP]->{wheels}->{$id}->set_output_filter(POE::Filter::Stream->new() );
unshift(@{$handlers->{Queue}},'Streaming');
next HANDLERS;
}
lib/POE/Component/Server/HTTP.pm view on Meta::CPAN
$response->header(%{$self->{Headers}});
unless ($response->header('Date')) {
$response->header('Date',time2str(time));
}
if (!($response->header('Content-Lenth')) && !($response->streaming())) {
use bytes;
$response->header('Content-Length',length($response->content));
}
$wheel->put($response);
lib/POE/Component/Server/HTTP.pm view on Meta::CPAN
If no handler installs a ContentHandler it will find the closest one
directory wise and use it.
There is also a special StreamHandler which is a coderef that gets
invoked if you have turned on streaming by doing
$response->streaming(1);
Handlers take the $request and $response objects as arguments.
=over 4
lib/POE/Component/Server/HTTP.pm view on Meta::CPAN
=item ContentHandler
The handler that is supposed to give the content. When this handler
returns it will send the response object to the client. It will
automaticly add Content-Length and Date if these are not set. If the
response is streaming it will make sure the correct headers are
set. It will also expand any cookies which have been pushed onto the
response object.
new(ContentHandler => { '/' => sub {}, '/foo/' => \&foo});
lib/POE/Component/Server/HTTP.pm view on Meta::CPAN
new(PostHandler => { '/' => [sub {}], '/foo/' => [\&foo]});
=item StreamHandler
If you turn on streaming in any other handler, the request is placed in
streaming mode. This handler is called, with the usual parameters, when
streaming mode is first entered, and subsequently when each block of data is
flushed to the client.
Streaming mode is turned on via the C<$response> object:
$response->streaming(1);
You deactivate streaming mode with the same object:
$response->close;
Content is also sent to the client via the C<$response> object:
lib/POE/Component/Server/HTTP.pm view on Meta::CPAN
}
sub someurl {
my($self, $resquest, $response)=@_;
$self->{todo} = [ .... ];
$response->streaming(1);
$response->code(RC_OK); # you must set up your response header
$response->content_type(...);
return RC_OK;
}
lib/POE/Component/Server/HTTP.pm view on Meta::CPAN
}
Another example can be found in t/30_stream.t. The parts dealing with
multipart/mixed are well documented and at the end of the file.
NOTE: Changes in streaming mode are only verified when StreamHandler exits.
So you must either turn streaming off in your StreamHandler, or make sure
that the StreamHandler will be called again. This last is done by sending
data to the client. If for some reason you have no data to send, you can
get the same result with C<continue>. Remember that this will also cause the
StreamHandler to be called one more time.
lib/POE/Component/Server/HTTP.pm view on Meta::CPAN
=item Write more tests
=item Add a PoCo::Server::HTTP::Session that matches a http session against poe session using cookies or other state system
=item Add more options to streaming
=item Figure out why post()ed C<shutdown> events don't get received.
=item Probably lots of other API changes
view all matches for this distribution
view release on metacpan or search on metacpan
t/03_prefork_stream.t view on Meta::CPAN
}
sub GOT_STREAM {
my ( $kernel, $heap, $response ) = @_[KERNEL, HEAP, ARG0];
# lets go on streaming ...
if ($heap->{'count'} <= 2) {
my $text = "Hello World ".$heap->{'count'}." \n";
# print "send ".$text."\n";
$response->content($text);
view all matches for this distribution
view release on metacpan or search on metacpan
examples/stream.pl view on Meta::CPAN
# the stream hash contains the wheel, the request, the response
# and an id associated the the wheel
$stream->{'wheel'}->put("Hello World\n");
# lets go on streaming ...
POE::Kernel->delay('GOT_STREAM', 1, $stream );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Declare/Log/File.pm view on Meta::CPAN
$_[SELF]->{state} = 'CRASH';
# Prevent additional message and flush queue
delete $_[SELF]->{buffer};
# Clean up streaming resources
$_[SELF]->clean;
return;
}
lib/POE/Declare/Log/File.pm view on Meta::CPAN
my $self = shift;
# Prevent additional messages and flush the queue
delete $self->{buffer};
# Clean up streaming resources
$self->clean;
# Pass through as normal
$self->SUPER::finish(@_);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Filter/XML.pm view on Meta::CPAN
builder => '_build_parser',
clearer => '_clear_parser'
);
has not_streaming =>
(
is => 'ro',
isa => 'Bool',
default => 0,
);
sub _build_handler {
my ($self) = @_;
POE::Filter::XML::Handler->new(not_streaming => $self->not_streaming)
}
sub _build_parser {
my ($self) = @_;
XML::LibXML->new(Handler => $self->handler)
lib/POE/Filter/XML.pm view on Meta::CPAN
if($self->handler->has_finished_nodes())
{
my $node = $self->handler->get_finished_node();
if($node->stream_end() or $self->not_streaming)
{
$self->parser->parse_chunk('', 1);
$self->reset();
}
lib/POE/Filter/XML.pm view on Meta::CPAN
The parser is XML::LibXML
=head1 PUBLIC_ATTRIBUTES
=head2 not_streaming
is: ro, isa: Bool, default: false
Setting the not_streaming attribute to true via new() will put this filter into
non-streaming mode, meaning that whole documents are parsed before nodes are
returned. This is handy for XMLRPC or other short documents.
=head1 PRIVATE_ATTRIBUTES
=head2 buffer
lib/POE/Filter/XML.pm view on Meta::CPAN
is: ro, isa: POE::Filter::XML::Handler
handler holds the SAX handler to be used for processing events from the parser.
By default POE::Filter::XML::Handler is instantiated and used.
The L</not_streaming> attribute is passed to the constructor of Handler.
=head2 parser
is: ro, isa: XML::LibXML
lib/POE/Filter/XML.pm view on Meta::CPAN
reset() is an internal method that gets called when either a stream_start(1)
POE::Filter::XML::Node gets placed into the filter via L</put>, or when a
stream_end(1) POE::Filter::XML::Node is pulled out of the queue of finished
Nodes via L</get_one>. This facilitates automagical behavior when using the
Filter within the XMPP protocol that requires many new stream initiations.
This method is also called after every document when not in streaming mode.
Useful for handling XMLRPC processing.
This method really should never be called outside of the Filter, but it is
documented here in case the Filter is used outside of the POE context.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Filter/Zlib.pm view on Meta::CPAN
=head1 DESCRIPTION
POE::Filter::Zlib provides a POE filter for performing compression/uncompression using L<Compress::Zlib>. It is
suitable for use with L<POE::Filter::Stackable>.
This filter is not ideal for streaming compressed data over sockets etc. as it employs compress and uncompress zlib functions.
L<POE::Filter::Zlib::Stream> is recommended for that type of activity.
=head1 CONSTRUCTOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POEx/HTTP/Server.pm view on Meta::CPAN
# Request has finished
if( not $self->{resp} or $self->{S}{done} or $self->{resp}->finished ) {
return $self->finish_request;
}
# streaming?
elsif( $self->{resp}->streaming ) {
return $self->send_more; # send some more
}
# The last possiblity is that calls to ->send have filled up the Wheel's
# or the driver's buffer and it was flushed.
lib/POEx/HTTP/Server.pm view on Meta::CPAN
#my $conn = $self->{req}->header('Connection')||'';
#$self->{will_close} = 0 if qq(,$conn,) =~ /,\s*keep-alive\s*,/i;
#warn "$$:conn=$conn will_close=$self->{will_close}";
}
$self->{will_close} = 1 if $self->{resp}->streaming;
#warn "$$:post streaming will_close=$self->{will_close}";
$self->{will_close} = 1 unless $self->{keepalive} > 1;
#warn "$$:post keepalive will_close=$self->{will_close}";
$self->{will_close} = 1 if $self->{shutdown};
DEBUG and
$self->D( "will_close=$self->{will_close}" );
lib/POEx/HTTP/Server.pm view on Meta::CPAN
unless( $self->{resp}->headers_sent ) {
$self->should_close;
$self->send_headers;
$self->{stream_wheel} = 1;
$self->{wheel}->set_output_filter( $self->build_stream_filter );
if( $self->{resp}->streaming ) {
eval {
$SIG{__DIE__} = 'DEFAULT';
$self->__tcp_hot;
};
warn $@ if $@;
}
}
$self->output( $something ) if defined $something;
if( $self->{resp}->streaming and $self->{wheel} ) {
$self->{wheel}->flush;
}
$self->timeout_start();
return;
}
# We are in streaming mode. The last chunk has flushed. Send a new one
sub send_more
{
my( $self ) = @_;
$self->timeout_stop();
$self->special_dispatch( 'stream_request', $self->{req}, $self->{resp} );
}
# We are in streaming mode. Turn off Nagle's algorithm
# This isn't as effective as you might think
sub __tcp_hot
{
my( $self ) = @_;
DEBUG and
lib/POEx/HTTP/Server.pm view on Meta::CPAN
# ...
}
=head3 stream_request
Invoked when a chunk has been flushed to the OS, if you are streaming a
response to the browser. Streaming is turned on with
L<POEx::HTTP::Server::Response/streaming>.
Please remember that while a chunk might be flushed, the OS's network layer
might still decide to combine several chunks into a single packet. And this
even though we setup a I<hot> socket with C<TCP_NODELAY> set to 1 and
C<SO_SNDBUF> to 576.
lib/POEx/HTTP/Server.pm view on Meta::CPAN
keepalive is deactivated for the connection. Finally difference
is that you will see C<L</stream_request>> when you are allowed to send the
next block. Look for C<L</post_request>> to find out when the last block has
been sent to the browser.
$resp->streaming( 1 );
$resp->header( 'Content-Length' => $size );
$resp->send;
When you want to send a chunk:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POEx/Role/PSGIServer.pm view on Meta::CPAN
return req_to_psgi(
$c->{request},
SERVER_NAME => $self->listen_ip,
SERVER_PORT => $self->listen_port,
SERVER_PROTOCOL => $c->{protocol},
'psgi.streaming' => Plack::Util::TRUE,
'psgi.nonblocking' => Plack::Util::TRUE,
'psgi.runonce' => Plack::Util::FALSE,
);
}
lib/POEx/Role/PSGIServer.pm view on Meta::CPAN
POEx::Role::PSGIServer encapsulates the core L<PSGI> server behaviors into an easy to consume and extend role. It is based on previous POEx work such as POEx::Role::TCPServer which provides basic TCP socket multiplexing via POE::Wheel::SocketFactory ...
=head2 RATIONALE
This Role has its roots firmly planted in POE::Component::Server::PSGI which provided the initial seed with the layout and logic of the basic server. Unfortunately, POE::Component::Server::PSGI didn't provide any mechnism for extension. The main goal...
=head1 CLASS_METHODS
=head2 around BUILDARGS
view all matches for this distribution
view release on metacpan or search on metacpan
- 1.1 beta
- Upped psgi.version to be [1,1]
- Lots of grammar and style fixes
- Removed poll_cb from writer spec
- Streaming interface now SHOULD be implemented, rather than MAY
- Promoted psgi.streaming, nonblocking and run_once keys to be MUST
- Added psgix.logger and psgix.session extensions
- Updated FAQ
1.03 Tue Oct 27 13:44:01 PDT 2009
- Added an optional callback interface to allow delayed response and streaming
1.02 Tue Oct 13 01:57:28 PDT 2009
- No spec changes. Just to let PAUSE index this stuff.
1.01 Tue Oct 13 01:17:28 PDT 2009
view all matches for this distribution
view release on metacpan or search on metacpan
share/dot-psgi/echo-stream.psgi view on Meta::CPAN
use AnyEvent;
my $app = sub {
my $env = shift;
warn "This app needs a server that supports psgi.streaming"
unless $env->{'psgi.streaming'};
my $cv = AE::cv;
return sub {
my $respond = shift;
my $w = $respond->([ 200, ['X-Foo' => 'bar', 'Content-Type' => 'text/plain'] ]);
view all matches for this distribution
view release on metacpan or search on metacpan
share/doc/wxwidgets.pod view on Meta::CPAN
virtual istream& LoadObject(istream& stream)
virtual wxInputStream& LoadObject(wxInputStream& stream)
Override this function and call it from your own LoadObject before
streaming your own data. LoadObject is called by the framework
automatically when the document contents need to be loaded.
Note that only one of these forms exists, depending on how wxWidgets
was configured.
share/doc/wxwidgets.pod view on Meta::CPAN
virtual ostream& SaveObject(ostream& stream)
virtual wxOutputStream& SaveObject(wxOutputStream& stream)
Override this function and call it from your own SaveObject before
streaming your own data. SaveObject is called by the framework
automatically when the document contents need to be saved.
Note that only one of these forms exists, depending on how wxWidgets
was configured.
share/doc/wxwidgets.pod view on Meta::CPAN
and then call wxMediaCtrl::Play to show the video/audio of the media
in that event.
More complex operations are generally more heavily dependant on the
capabilities of the backend. For example, QuickTime cannot set the
playback rate of certain streaming media - while DirectShow is
slightly more flexible in that regard.
=head2 Operation
When wxMediaCtrl plays a file, it plays until the stop position is
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Padre/Task/Run.pm view on Meta::CPAN
package Padre::Task::Run;
# Generic task for executing programs via system() and streaming
# their output back to the main program.
use 5.008005;
use strict;
use warnings;
view all matches for this distribution
view release on metacpan or search on metacpan
root/static/yui/charts/charts-debug.js view on Meta::CPAN
}
return "";
}
};
/* fix for video streaming bug */
YAHOO.deconcept.SWFObjectUtil.cleanupSWFs = function()
{
var objects = document.getElementsByTagName("OBJECT");
for(var i = objects.length - 1; i >= 0; i--)
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Parse/CSV.pm view on Meta::CPAN
This method is fine unless your CSV files start to get large. Once that
happens, the only existing option is to fall back on the relatively slow
and heavyweight L<XML::SAXDriver::CSV> module.
L<Parse::CSV> fills this functionality gap. It provides a flexible
and light-weight streaming parser for large, extremely large, or
arbitrarily large CSV files.
=head2 Main Features
B<Stream-Based Parser> - All parsing a line at a time.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Parse/DebControl.pm view on Meta::CPAN
=item * CHANGES file now generated automatically
=item * Fixes for potential test suite failure in Pod::Coverage run
=item * Adds the "addNewline" option to write_file to solve the streaming stanza problem.
=item * Adds tests for the addNewline option
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Parse/Gnaw/Blocks/ParsingMethods.pm view on Meta::CPAN
read in the entire stream (petabytes) into memory and crash the system.
if it doesn't crash, it will back up until it finds amatch.
We default to thrifty matching, meaning we only read in as little as possible
to still find a match. This means we only read in just as much of the
stream as we need to find a match.
We can DO greedy matching, but it can be a problem if we're streaming massive quantities of data.
basic thrifty algorithm:
try the rule at least min times.
if that matches, then return and let rest of grammar try.
If rest of grammar dies, then revert to min location
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Parse/M3U/Extended.pm view on Meta::CPAN
=head1 SEE ALSO
=over
=item * IETF Internet Draft: draft-pantos-http-live-streaming-08
=back
=head1 COPYRIGHT
view all matches for this distribution
view release on metacpan or search on metacpan
examples/7.0.3/asup01.txt view on Meta::CPAN
Sat Mar 17 21:00:00 PDT [oren-netapp: kern.uptime.filer:info]: 9:00pm up 963 days, 9:06 204327914692 NFS ops, 0 CIFS ops, 694 HTTP ops, 0 DAFS ops, 0 FCP ops, 0 iSCSI ops
Sat Mar 17 22:00:00 PDT [oren-netapp: kern.uptime.filer:info]: 10:00pm up 963 days, 10:06 204340168883 NFS ops, 0 CIFS ops, 694 HTTP ops, 0 DAFS ops, 0 FCP ops, 0 iSCSI ops
Sat Mar 17 23:00:00 PDT [oren-netapp: kern.uptime.filer:info]: 11:00pm up 963 days, 11:06 204344688894 NFS ops, 0 CIFS ops, 694 HTTP ops, 0 DAFS ops, 0 FCP ops, 0 iSCSI ops
Sun Mar 18 00:00:00 PDT [oren-netapp: kern.uptime.filer:info]: 12:00am up 963 days, 12:06 204348443008 NFS ops, 0 CIFS ops, 694 HTTP ops, 0 DAFS ops, 0 FCP ops, 0 iSCSI ops
<perf-info><object-info><objectname>system</objectname><counters><counter-info><name>nfs_ops</name><desc>NFS operations per second</desc><privilege-level>basic</privilege-level><properties>rate</properties><unit>per_sec</unit></counter-info><counter-...
view all matches for this distribution
view release on metacpan or search on metacpan
0.202 2023-11-27 07:23:21-05:00 America/New_York
0.106 2016-08-07 19:19:46-04:00 America/New_York
Adding an is_smallbiz() function to check for small business.
Adding a script to demonstrate streaming use of data
0.105 2016-08-07 17:04:51-04:00 America/New_York
Fixing documentation error. Adding an example script
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Parse/WBXML.pm view on Meta::CPAN
the other modules in L</SEE ALSO> first. The current API may change before the 1.0
release.
Provides a pure-Perl implementation for the WBXML compressed XML format.
Slower and less efficient than the libwbxml2-based alternatives (L</SEE ALSO>),
but supports streaming SAX-like parsing.
This may be of some use in low-bandwidth situations where you want data as soon
as available from the stream, or in cases where the document is damaged and you
want to recover as much data as possible, or if you just don't have libwbxml2
available.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Paws/AppStream.pm view on Meta::CPAN
Amazon AppStream 2.0
This is the I<Amazon AppStream 2.0 API Reference>. This documentation
provides descriptions and syntax for each of the actions and data types
in AppStream 2.0. AppStream 2.0 is a fully managed, secure application
streaming service that lets you stream desktop applications to users
without rewriting applications. AppStream 2.0 manages the AWS resources
that are required to host and run your applications, scales
automatically, and provides access to your users on demand.
You can call the AppStream 2.0 API operations by using an interface VPC
lib/Paws/AppStream.pm view on Meta::CPAN
Each argument is described in detail in: L<Paws::AppStream::CreateFleet>
Returns: a L<Paws::AppStream::CreateFleetResult> instance
Creates a fleet. A fleet consists of streaming instances that run a
specified image.
=head2 CreateImageBuilder
lib/Paws/AppStream.pm view on Meta::CPAN
Each argument is described in detail in: L<Paws::AppStream::CreateImageBuilderStreamingURL>
Returns: a L<Paws::AppStream::CreateImageBuilderStreamingURLResult> instance
Creates a URL to start an image builder streaming session.
=head2 CreateStack
=over
lib/Paws/AppStream.pm view on Meta::CPAN
Each argument is described in detail in: L<Paws::AppStream::CreateStack>
Returns: a L<Paws::AppStream::CreateStackResult> instance
Creates a stack to start streaming applications to users. A stack
consists of an associated fleet, user access policies, and storage
configurations.
=head2 CreateStreamingURL
lib/Paws/AppStream.pm view on Meta::CPAN
Each argument is described in detail in: L<Paws::AppStream::CreateStreamingURL>
Returns: a L<Paws::AppStream::CreateStreamingURLResult> instance
Creates a temporary URL to start an AppStream 2.0 streaming session for
the specified user. A streaming URL enables application streaming to be
tested without user setup.
=head2 CreateUpdatedImage
lib/Paws/AppStream.pm view on Meta::CPAN
Each argument is described in detail in: L<Paws::AppStream::DeleteDirectoryConfig>
Returns: a L<Paws::AppStream::DeleteDirectoryConfigResult> instance
Deletes the specified Directory Config object from AppStream 2.0. This
object includes the information required to join streaming instances to
an Active Directory domain.
=head2 DeleteFleet
lib/Paws/AppStream.pm view on Meta::CPAN
Each argument is described in detail in: L<Paws::AppStream::DeleteStack>
Returns: a L<Paws::AppStream::DeleteStackResult> instance
Deletes the specified stack. After the stack is deleted, the
application streaming environment provided by the stack is no longer
available to users. Also, any reservations made for application
streaming sessions for the stack are released.
=head2 DeleteUsageReportSubscription
lib/Paws/AppStream.pm view on Meta::CPAN
Each argument is described in detail in: L<Paws::AppStream::DescribeSessions>
Returns: a L<Paws::AppStream::DescribeSessionsResult> instance
Retrieves a list that describes the streaming sessions for a specified
stack and fleet. If a UserId is provided for the stack and fleet, only
streaming sessions for that user are described. If an authentication
type is not provided, the default is to authenticate users using a
streaming URL.
=head2 DescribeStacks
=over
lib/Paws/AppStream.pm view on Meta::CPAN
Each argument is described in detail in: L<Paws::AppStream::ExpireSession>
Returns: a L<Paws::AppStream::ExpireSessionResult> instance
Immediately stops the specified streaming session.
=head2 ListAssociatedFleets
=over
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PawsX/Waiter/waiters.json view on Meta::CPAN
{"mediaconnect":{"2018-11-14":{"FlowActive":{"description":"Wait until a flow is active","acceptors":[{"state":"success","expected":"ACTIVE","matcher":"path","argument":"Flow.Status"},{"state":"retry","expected":"STARTING","matcher":"path","argument"...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Plack/Middleware/PeriAHS/Respond.pm view on Meta::CPAN
sub call {
log_trace("=> PeriAHS::Respond middleware");
my ($self, $env) = @_;
die "This middleware needs psgi.streaming support"
unless $env->{'psgi.streaming'};
my $rreq = $env->{"riap.request"};
my $pa = $env->{"periahs.riap_client"}
or die "\$env->{'periahs.riap_client'} not defined, ".
"perhaps ParseRequest middleware has not run?";
view all matches for this distribution
view release on metacpan or search on metacpan
Perinci::Result::Format. There are now Perinci-CmdLine and
Perinci-CmdLine-Lite distributions.
- Refactoring: run() and run_*() now returns enveloped response instead
of int. All output is now returned as string by run_*() instead of
printed directly (except for streaming output).
- Refactoring: No long uses internal attributes like
$self->{_subcommand}. Instead, now a per-request (per-run())
stash/hash $r is passed around. This is not unlike the technique used
in Apache handlers and Data::Sah. It's cleaner because the
display_result() (should not be a problem because it's not yet
documented).
[ENHANCEMENTS]
- Support streaming output (function needs to set result metadata
is_stream => 1 and result needs to be glob/IO::Handle/array/tied
array, format needs to be text).
- Observe 'x.perinci.cmdline.default_format' metadata attribute.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perinci/CmdLine/Inline.pm view on Meta::CPAN
my @modules_for_all_args;
my @req_stmts;
for my $arg (sort keys %$args_prop) {
my $arg_spec = $args_prop->{$arg};
# we don't validate streaming input for now
next if $arg_spec->{stream};
my $arg_schema = $arg_spec->{schema};
my $arg_term = '$args->{"'.$arg.'"}';
if (defined $arg_spec->{default}) {
lib/Perinci/CmdLine/Inline.pm view on Meta::CPAN
$shebang_line = $args{shebang} // $^X;
$shebang_line = "#!$shebang_line" unless $shebang_line =~ /\A#!/;
$shebang_line .= "\n" unless $shebang_line =~ /\R\z/;
}
# this will be removed if we don't use streaming input or read from
# stdin
$cd->{sub_srcs}{_pci_gen_iter} = <<'_';
require Data::Sah::Util::Type;
my ($fh, $type, $argname) = @_;
if (Data::Sah::Util::Type::is_simple($type)) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perinci/CmdLine/Base.pm view on Meta::CPAN
#log_trace("TMP: handle cmdline_src for arg=%s", $an);
my $as = $args_p->{$an};
my $src = $as->{cmdline_src};
my $type = $as->{schema}[0]
or die "BUG: No schema is defined for arg '$an'";
# Riap::HTTP currently does not support streaming input
my $do_stream = $as->{stream} && $url !~ /^https?:/;
if ($src) {
die [531,
"Invalid 'cmdline_src' value for argument '$an': $src"]
unless $src =~ /\A(stdin|file|stdin_or_files?|stdin_or_args|stdin_line)\z/;
lib/Perinci/CmdLine/Base.pm view on Meta::CPAN
All direct subclasses of PC:Base do the formatting here.
=head2 $cmd->hook_display_result($r)
The hook is supposed to display the formatted result (stored in C<$r->{fres}>)
to STDOUT. But in the case of streaming output, this hook can also set it up.
All direct subclasses of PC:Base do the formatting here.
=head2 $cmd->hook_after_run($r)
lib/Perinci/CmdLine/Base.pm view on Meta::CPAN
and then skip saving output.
Data that is not representable as JSON will be cleansed using
L<Data::Clean::ForJSON>.
Streaming output will not be saved appropriately, because streaming output
contains coderef that will be called repeatedly during the normal displaying of
result.
=head2 PERINCI_CMDLINE_PLUGINS
view all matches for this distribution
view release on metacpan or search on metacpan
1.811.0 2018-03-17 Released-By: PERLANCAR
- Synchronize version with latest Perinci::CmdLine::Lite.
- [doc] Add FAQ section "Progress Indicator", add example for streaming
a file in output, add list of tutorial pages to fill in later.
1.77 2017-07-31 Released-By: PERLANCAR
view all matches for this distribution
view release on metacpan or search on metacpan
script/peri-eg-read-file view on Meta::CPAN
[--format-options=s] [--format=name] [--json] [--(no)naked-res]
[--no-config] [--no-env] <path>
=head1 DESCRIPTION
This function demonstrate output streaming of bytes.
To do output streaming, on the function side, you just return a coderef which
can be called by caller (e.g. CLI framework L<Perinci::CmdLine>) to read data
from. Code must return data or undef to signify exhaustion.
This works over remote (HTTP) too, because output streaming is supported by
L<Riap::HTTP> (version 1.2) and L<Perinci::Access::HTTP::Client>. Streams
are translated into HTTP chunks.
=head1 OPTIONS
view all matches for this distribution
view release on metacpan or search on metacpan
script/peri-eg-read-file-lite view on Meta::CPAN
[--(no)naked-res] [--no-config | -C] [--no-env]
[--page-result[=program]] <path>
=head1 DESCRIPTION
This function demonstrate output streaming of bytes.
To do output streaming, on the function side, you just return a coderef which
can be called by caller (e.g. CLI framework L<Perinci::CmdLine>) to read data
from. Code must return data or undef to signify exhaustion.
This works over remote (HTTP) too, because output streaming is supported by
L<Riap::HTTP> (version 1.2) and L<Perinci::Access::HTTP::Client>. Streams
are translated into HTTP chunks.
=head1 OPTIONS
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perinci/Examples/FilePartial.pm view on Meta::CPAN
The functions are separated into this module because these functions read/write
files on the filesystem and might potentially be dangerous if
`Perinci::Examples` is exposed to the network by accident.
See also `Perinci::Examples::FileStream` which uses streaming instead of
partial.
_
};
lib/Perinci/Examples/FilePartial.pm view on Meta::CPAN
The functions are separated into this module because these functions read/write
files on the filesystem and might potentially be dangerous if
C<Perinci::Examples> is exposed to the network by accident.
See also C<Perinci::Examples::FileStream> which uses streaming instead of
partial.
=head1 FUNCTIONS
view all matches for this distribution