IO-Lambda

 view release on metacpan or  search on metacpan

lib/IO/Lambda/Loop/POE.pm  view on Meta::CPAN

{
	$kr_last_session = $$kr_active_session;
	$$kr_active_session = $session;

	my ($self, $rec) = @_;

	my $t = @timers;
	@timers = grep { $_ != $rec } @timers;
	reset_timer if $t != @timers;
	purge_filenos { $_ != $rec };
	reset_session(0);

	$$kr_active_session = $kr_last_session;
}

sub yield
{
	warn "yield\n" if $DEBUG;
	my ( $self, $nonblocking ) = @_;
	local $event = 0;
	$poe_kernel-> run_one_timeslice;
	# that ssession should be the kernel itself
	$poe_kernel-> run if $poe_kernel-> _data_ses_count == 1;
	
	return if $nonblocking;
	$poe_kernel-> run_one_timeslice while $event == 0;
	$poe_kernel-> run if $poe_kernel-> _data_ses_count == 1;
}

sub signal { $event++ }

1;

__DATA__

=pod

=head1 NAME

IO::Lambda::Loop::POE - POE event loop for IO::Lambda

=head1 DESCRIPTION

This is the implementation of event loop for C<IO::Lambda> based on C<POE> event
loop. The module is not intended for direct use.

=head1 LIMITATIONS

Note that L<POE> is also a proxy event loop itself, and depending on the
actual event loop module it uses, functionality of C<IO::Lambda> might be
limited. 

=head1 SYNOPSIS

  use POE;
  use IO::Lambda::Loop::POE; # explicitly select the event loop module
  use IO::Lambda;

or

  setenv IO_LAMBDA_DEBUG=loop=POE

=head1 BUGS

Threads and forks seem to be not playing nicely together with POE.

=head1 SEE ALSO

L<POE>



( run in 1.329 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )