POE-Loop-Event-1.305/000755 000765 000024 00000000000 12205000217 014232 5ustar00trocstaff000000 000000 POE-Loop-Event-1.305/CHANGES000644 000765 000024 00000002042 12205000217 015223 0ustar00trocstaff000000 000000 ================================ 2013-08-20 19:47:58 -0400 v1_305 ================================ commit 8068624c6e4bfdee879d89cd80fe56a0c3e5e818 Author: Rocco Caputo Date: Tue Aug 20 19:47:58 2013 -0400 Bump version for release. commit 2a2863de5680dbab7f109dc656d5808ae596ae04 Author: Rocco Caputo Date: Tue Aug 20 19:25:56 2013 -0400 Update copyright notice and repository URL. commit f5ab8443e09b58e9d74634a5786deb498e4a6890 Author: Rocco Caputo Date: Tue Aug 20 19:23:35 2013 -0400 Update dependencies, and switch CHANGES to git-log. commit 79e9dc3f31eafe49973826deca4d565a742a4aeb Author: Rocco Caputo Date: Tue Aug 20 13:41:21 2013 -0400 Remove artifact from Snerp::Vortex conversion. commit 95fb7fc6664209f0ca76dc8bf6dd97e3502d8c30 Author: Rocco Caputo Date: Tue Sep 7 22:06:24 2010 -0400 Promote polo-event files to top level. ============== End of Excerpt ============== POE-Loop-Event-1.305/lib/000755 000765 000024 00000000000 12205000216 014777 5ustar00trocstaff000000 000000 POE-Loop-Event-1.305/Makefile.PL000644 000765 000024 00000005050 12204777321 016224 0ustar00trocstaff000000 000000 #!/usr/bin/perl # rocco // vim: ts=2 sw=2 expandtab use warnings; use strict; use ExtUtils::MakeMaker; use POE::Test::Loops; # Switch to default behavior if STDIN isn't a tty. unless (-t STDIN) { warn( "\n", "=============================================\n\n", "STDIN is not a terminal. Assuming --default.\n\n", "=============================================\n\n", ); push @ARGV, "--default"; } # Remind the user she can use --default. unless (grep /^--default$/, @ARGV) { warn( "\n", "=============================================\n\n", "Prompts may be bypassed by running:\n", " $^X $0 --default\n\n", "=============================================\n\n", ); } # Should we skip the network tests? my $prompt = ( "Some of POE::Loop::Event's tests require a\n" . "functional network. You can skip these network\n" . "tests if you'd like.\n\n" . "Would you like to skip the network tests?" ); my $ret = "n"; if (grep /^--default$/, @ARGV) { print $prompt, " [$ret] $ret\n\n"; } else { $ret = prompt($prompt, "n"); } my $marker = 'run_network_tests'; unlink $marker; unless ($ret =~ /^Y$/i) { open(TOUCH,"+>$marker") and close TOUCH; } print "\n"; ### Touch files that will be generated at "make dist" time. ### ExtUtils::MakeMaker and Module::Build will complain about them if ### they aren't present now. open(TOUCH, ">>CHANGES") and close TOUCH; open(TOUCH, ">>META.yml") and close TOUCH; POE::Test::Loops::generate( 't', [ 'POE::Loop::Event' ], 0 ); WriteMakefile( NAME => 'POE::Loop::Event', AUTHOR => 'Rocco Caputo ', ABSTRACT => 'Event.pm support for POE.', VERSION_FROM => 'lib/POE/Loop/Event.pm', META_ADD => { resources => { license => 'http://dev.perl.org/licenses/', repository => ( 'https://github.com/rcaputo/poe-loop-event.git' ), }, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', PREOP => ( 'git-log.pl | ' . '/usr/bin/tee ./$(DISTNAME)-$(VERSION)/CHANGES > ./CHANGES; ' ), }, clean => { FILES => 't/poe_loop_event/*.t t/poe_loop_event ' . $marker }, test => { TESTS => 't/*.t t/poe_loop_event/*.t' }, CONFIGURE_REQUIRES => { 'ExtUtils::MakeMaker' => 0, 'POE::Test::Loops' => 1.352, }, META_MERGE => { build_requires => { 'POE::Test::Loops' => 1.352, }, }, PREREQ_PM => { 'POE' => 1.356, 'Event' => 1.21, }, ); 1; POE-Loop-Event-1.305/MANIFEST000644 000765 000024 00000000261 12205000217 015362 0ustar00trocstaff000000 000000 CHANGES MANIFEST MANIFEST.SKIP META.yml Makefile.PL README lib/POE/Loop/Event.pm t/00_info.t META.json Module JSON meta-data (added by MakeMaker) POE-Loop-Event-1.305/MANIFEST.SKIP000644 000765 000024 00000000424 11440552131 016137 0ustar00trocstaff000000 000000 CVS \.\# \.bak$ \.cvsignore \.gz$ \.orig$ \.patch$ \.ppd$ \.rej$ \.rej$ \.svn \.swo$ \.swp$ ^Makefile$ ^Makefile\.old$ ^\. ^_Inline ^_build ^blib/ ^comptest ^cover_db ^coverage\.report$ ^docs ^pm_to_blib$ ^poe_report\.xml$ run_network_tests test-output\.err$ t/[23]0_.*\.t ~$ POE-Loop-Event-1.305/META.json000644 000765 000024 00000002232 12205000217 015652 0ustar00trocstaff000000 000000 { "abstract" : "Event.pm support for POE.", "author" : [ "Rocco Caputo " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.132140", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "POE-Loop-Event", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0", "POE::Test::Loops" : "1.352" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "POE::Test::Loops" : "1.352" } }, "runtime" : { "requires" : { "Event" : "1.21", "POE" : "1.356" } } }, "release_status" : "stable", "resources" : { "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "url" : "https://github.com/rcaputo/poe-loop-event.git" } }, "version" : "1.305" } POE-Loop-Event-1.305/META.yml000644 000765 000024 00000001231 12205000217 015500 0ustar00trocstaff000000 000000 --- abstract: 'Event.pm support for POE.' author: - 'Rocco Caputo ' build_requires: ExtUtils::MakeMaker: 0 POE::Test::Loops: 1.352 configure_requires: ExtUtils::MakeMaker: 0 POE::Test::Loops: 1.352 dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.132140' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: POE-Loop-Event no_index: directory: - t - inc requires: Event: 1.21 POE: 1.356 resources: license: http://dev.perl.org/licenses/ repository: https://github.com/rcaputo/poe-loop-event.git version: 1.305 POE-Loop-Event-1.305/README000644 000765 000024 00000000723 12204774437 015141 0ustar00trocstaff000000 000000 POE supports nearly any event loop imaginable through POE::Loop plugin modules. POE::Loop::Event is the plugin support for Joshua Pritikin's Event module. See http://search.cpan.org/search?query=POE%3A%3ALoop&mode=module for a list of other event loops POE supports. POE::Loop documents the generic API for all POE::Loop subclasses. You are invited to implement this API for your favorite event loop. Kudos, bug reports, and patches are also welcome. Thank you! POE-Loop-Event-1.305/t/000755 000765 000024 00000000000 12205000216 014474 5ustar00trocstaff000000 000000 POE-Loop-Event-1.305/t/00_info.t000644 000765 000024 00000000264 12204774437 016143 0ustar00trocstaff000000 000000 #!/usr/bin/perl use strict; use warnings; use Test::More tests => 1; use_ok( 'POE' ); # idea from Test::Harness, thanks! diag("Testing POE $POE::VERSION, Perl $], $^X on $^O"); POE-Loop-Event-1.305/lib/POE/000755 000765 000024 00000000000 12205000216 015422 5ustar00trocstaff000000 000000 POE-Loop-Event-1.305/lib/POE/Loop/000755 000765 000024 00000000000 12205000216 016333 5ustar00trocstaff000000 000000 POE-Loop-Event-1.305/lib/POE/Loop/Event.pm000644 000765 000024 00000013177 12205000043 017761 0ustar00trocstaff000000 000000 # Event.pm event loop bridge for POE::Kernel. # Empty package to appease perl. package POE::Loop::Event; use strict; # Include common signal handling. Signals should be safe now, and for # some reason Event isn't dispatching SIGCHLD to me circa POE r2084. use POE::Loop::PerlSignals; use vars qw($VERSION); $VERSION = '1.305'; # NOTE - Should be #.### (three decimal places) =for poe_tests sub skip_tests { return "Event tests require the Event module" if ( do { eval "use Event"; $@ } ); my $test_name = shift; if ($test_name eq "k_signals_rerun" and $^O eq "MSWin32") { return "This test crashes Perl when run with Tk on $^O"; } if ($test_name eq "wheel_readline" and $^O eq "darwin") { return "Event skips two of its own tests for the same reason"; } } =cut # Everything plugs into POE::Kernel. package POE::Kernel; use strict; use Event; my $_watcher_timer; my @fileno_watcher; my %signal_watcher; #------------------------------------------------------------------------------ # Loop construction and destruction. sub loop_initialize { my $self = shift; $_watcher_timer = Event->timer( cb => \&_loop_event_callback, desc => 'dispatch_timer', after => 0, ); } sub loop_finalize { my $self = shift; foreach my $fd (0..$#fileno_watcher) { next unless defined $fileno_watcher[$fd]; foreach my $mode (MODE_RD, MODE_WR, MODE_EX) { POE::Kernel::_warn( "Mode $mode watcher for fileno $fd is defined during loop finalize" ) if defined $fileno_watcher[$fd]->[$mode]; } } $self->loop_ignore_all_signals(); } #------------------------------------------------------------------------------ # Signal handler maintenance functions. sub loop_attach_uidestroy { # does nothing } #------------------------------------------------------------------------------ # Maintain time watchers. sub loop_resume_time_watcher { my ($self, $next_time) = @_; ($_watcher_timer and $next_time) or return; $_watcher_timer->at($next_time); $_watcher_timer->start(); } sub loop_reset_time_watcher { my ($self, $next_time) = @_; $_watcher_timer or return; $self->loop_pause_time_watcher(); $self->loop_resume_time_watcher($next_time); } sub loop_pause_time_watcher { $_watcher_timer or return; $_watcher_timer->stop(); } #------------------------------------------------------------------------------ # Maintain filehandle watchers. sub loop_watch_filehandle { my ($self, $handle, $mode) = @_; my $fileno = fileno($handle); # Overwriting a pre-existing watcher? if (defined $fileno_watcher[$fileno]->[$mode]) { $fileno_watcher[$fileno]->[$mode]->cancel(); undef $fileno_watcher[$fileno]->[$mode]; } $fileno_watcher[$fileno]->[$mode] = Event->io( fd => $fileno, desc => "io_watcher $handle $fileno $mode", poll => ( ( $mode == MODE_RD ) ? 'r' : ( ( $mode == MODE_WR ) ? 'w' : 'e' ) ), cb => \&_loop_select_callback, ); } sub loop_ignore_filehandle { my ($self, $handle, $mode) = @_; my $fileno = fileno($handle); # Don't bother removing a select if none was registered. if (defined $fileno_watcher[$fileno]->[$mode]) { $fileno_watcher[$fileno]->[$mode]->cancel(); undef $fileno_watcher[$fileno]->[$mode]; } } sub loop_pause_filehandle { my ($self, $handle, $mode) = @_; my $fileno = fileno($handle); $fileno_watcher[$fileno]->[$mode]->stop(); } sub loop_resume_filehandle { my ($self, $handle, $mode) = @_; my $fileno = fileno($handle); $fileno_watcher[$fileno]->[$mode]->start(); } # Timer callback to dispatch events. my $last_time = time(); sub _loop_event_callback { my $self = $poe_kernel; if (TRACE_STATISTICS) { # TODO - I'm pretty sure the startup time will count as an unfair # amount of idleness. # # TODO - Introducing many new time() syscalls. Bleah. $self->_data_stat_add('idle_seconds', time() - $last_time); } $self->_data_ev_dispatch_due(); $self->_test_if_kernel_is_idle(); # Transferring control back to Event; this is idle time. $last_time = time() if TRACE_STATISTICS; } # Event filehandle callback to dispatch selects. sub _loop_select_callback { my $self = $poe_kernel; my $event = shift; my $watcher = $event->w; my $fileno = $watcher->fd; my $mode = ( ( $event->got eq 'r' ) ? MODE_RD : ( ( $event->got eq 'w' ) ? MODE_WR : ( ( $event->got eq 'e' ) ? MODE_EX : return ) ) ); $self->_data_handle_enqueue_ready($mode, $fileno); $self->_test_if_kernel_is_idle(); } #------------------------------------------------------------------------------ # The event loop itself. sub loop_do_timeslice { Event::one_event(); } sub loop_run { my $self = shift; # Avoid a hang when trying to run an idle Kernel. $self->_test_if_kernel_is_idle(); while ($self->_data_ses_count()) { $self->loop_do_timeslice(); } } sub loop_halt { $_watcher_timer->stop(); $_watcher_timer = undef; Event::unloop_all(0); } 1; __END__ =head1 NAME POE::Loop::Event - a bridge that allows POE to be driven by Event.pm =head1 SYNOPSIS See L. =head1 DESCRIPTION POE::Loop::Event implements the interface documented in L. Therefore it has no documentation of its own. Please see L for more details. =head1 SEE ALSO L, L, L, L =head1 AUTHORS & LICENSING POE::Loop::Event is Copyright 1998-2013 Rocco Caputo. All rights reserved. POE::Loop::Event is free software; you may redistribute it and/or modify it under the same terms as Perl itself. =cut # rocco // vim: ts=2 sw=2 expandtab # TODO - Edit.