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.2 by root, Tue Jul 21 03:35:50 2009 UTC

34use AnyEvent (); 34use AnyEvent ();
35use BDB (); 35use BDB ();
36 36
37use base Exporter::; 37use base Exporter::;
38 38
39our $VERSION = '1.0'; 39our $VERSION = '1.1';
40our $WATCHER; 40our $WATCHER;
41 41
42$WATCHER = AnyEvent::post_detect { 42my $guard = AnyEvent::post_detect {
43 if ($AnyEvent::MODEL eq "AnyEvent::Impl::EV") {
44 $WATCHER = EV::io (BDB::poll_fileno, &EV::READ, \&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); 43 $WATCHER = AnyEvent->io (fh => BDB::poll_fileno, poll => 'r', cb => \&BDB::poll_cb);
48 }
49}; 44};
45$WATCHER ||= $guard;
50 46
51BDB::_on_next_submit \&AnyEvent::detect; 47BDB::_on_next_submit \&AnyEvent::detect;
52 48
53=head1 SEE ALSO 49=head1 SEE ALSO
54 50

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines