… | |
… | |
25 | db_sync $db; |
25 | db_sync $db; |
26 | |
26 | |
27 | # when you also use Coro, management is easy: |
27 | # when you also use Coro, management is easy: |
28 | use Coro::BDB; |
28 | use Coro::BDB; |
29 | |
29 | |
30 | # automatic result processing with AnyEvent: |
30 | # automatic event loop intergration with AnyEvent: |
31 | our $FH; open $FH, "<&=" . BDB::poll_fileno; |
31 | use AnyEvent::BDB; |
32 | our $WATCHER = AnyEvent->io (fh => $FH, poll => 'r', cb => \&BDB::poll_cb); |
|
|
33 | |
32 | |
34 | # automatic result processing with EV: |
33 | # automatic result processing with EV: |
35 | my $WATCHER = EV::io BDB::poll_fileno, EV::READ, \&BDB::poll_cb; |
34 | my $WATCHER = EV::io BDB::poll_fileno, EV::READ, \&BDB::poll_cb; |
36 | |
35 | |
37 | # with Glib: |
36 | # with Glib: |
… | |
… | |
610 | with an operating system error or DB_LOCK_NOTGRANTED, the internal |
609 | with an operating system error or DB_LOCK_NOTGRANTED, the internal |
611 | TXN_DEADLOCK flag will be set on the transaction. See C<db_txn_finish>, |
610 | TXN_DEADLOCK flag will be set on the transaction. See C<db_txn_finish>, |
612 | above. |
611 | above. |
613 | |
612 | |
614 | SEE ALSO |
613 | SEE ALSO |
615 | Coro::BDB, IO::AIO. |
614 | AnyEvent::BDB (event loop integration), Coro::BDB (more natural syntax), |
|
|
615 | IO::AIO (nice to have). |
616 | |
616 | |
617 | AUTHOR |
617 | AUTHOR |
618 | Marc Lehmann <schmorp@schmorp.de> |
618 | Marc Lehmann <schmorp@schmorp.de> |
619 | http://home.schmorp.de/ |
619 | http://home.schmorp.de/ |
620 | |
620 | |