ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-BDB/BDB.pm
(Generate patch)

Comparing AnyEvent-BDB/BDB.pm (file contents):
Revision 1.1 by root, Sat May 10 20:22:29 2008 UTC vs.
Revision 1.3 by root, Fri Jun 10 02:10:39 2011 UTC

26 26
27=cut 27=cut
28 28
29package AnyEvent::BDB; 29package AnyEvent::BDB;
30 30
31use strict; 31use common::sense;
32no warnings;
33 32
34use AnyEvent (); 33use AnyEvent ();
35use BDB (); 34use BDB ();
36 35
37use base Exporter::; 36use base Exporter::;
38 37
39our $VERSION = '1.0'; 38our $VERSION = '1.1';
40our $WATCHER; 39our $WATCHER;
41 40
42$WATCHER = AnyEvent::post_detect { 41my $guard = AnyEvent::post_detect {
43 if ($AnyEvent::MODEL eq "AnyEvent::Impl::EV") {
44 $WATCHER = EV::io (BDB::poll_fileno, &EV::READ, \&BDB::poll_cb); 42 $WATCHER = AE::io BDB::poll_fileno, 0, \&BDB::poll_cb;
45 } else {
46 our $FH; open $FH, "<&=" . BDB::poll_fileno;
47 $WATCHER = AnyEvent->io (fh => $FH, poll => 'r', cb => \&BDB::poll_cb);
48 }
49}; 43};
44$WATCHER ||= $guard;
50 45
51BDB::_on_next_submit \&AnyEvent::detect; 46BDB::_on_next_submit \&AnyEvent::detect;
52 47
53=head1 SEE ALSO 48=head1 SEE ALSO
54 49

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines