Future

 view release on metacpan or  search on metacpan

lib/Future.pm  view on Meta::CPAN

Returns the C<$future>.

=cut

sub die :method
{
   my $self = shift;
   my ( $exception, @more ) = @_;

   if( !ref $exception and $exception !~ m/\n$/ ) {
      $exception .= sprintf " at %s line %d\n", (caller)[1,2];
   }

   $self->fail( $exception, @more );
}

=head2 on_cancel

   $future->on_cancel( $code );

If the future is not yet ready, adds a callback to be invoked if the future is

lib/Future/PP.pm  view on Meta::CPAN

}

my $GLOBAL_END;
END { $GLOBAL_END = 1; }

sub DESTROY_debug {
   my $self = shift;
   return if $GLOBAL_END;
   return if $self->{ready} and ( $self->{reported} or !$self->{failure} );

   my $lost_at = join " line ", (caller)[1,2];
   # We can't actually know the real line where the last reference was lost; 
   # a variable set to 'undef' or close of scope, because caller can't see it;
   # the current op has already been updated. The best we can do is indicate
   # 'near'.

   if( $self->{ready} and $self->{failure} ) {
      warn "${\$self->__selfstr} was lost near $lost_at with an unreported failure of: " .
         $self->{failure}[0] . "\n";
   }
   elsif( !$self->{ready} ) {



( run in 0.716 second using v1.01-cache-2.11-cpan-a3c8064c92c )