BDB(3pm)

πŸ’– BDB πŸ’–

okay bestie, sit DOWN, because this is Coro::BDB β€” truly asynchronous bdb access ✨ and honestly? it's giving main character energy for your event loop πŸŽ€


✨ NAME ✨

Coro::BDB β€” truly asynchronous bdb access πŸ’…

no cap, that's the whole vibe: it makes your bdb stuff actually async instead of just sitting there blocking everyone.


🌸 SYNOPSIS 🌸

use Coro::BDB;
use BDB;

# can now use any of the bdb requests

that's it, that's the whole ritual 🫢 load Coro::BDB, load BDB, and boom β€” you can now use any of the bdb requests. iconic.


πŸ¦‹ DESCRIPTION πŸ¦‹

First thing's first, bestie: this module is an AnyEvent user, which means you need to make sure that you use and run a supported event loop. no event loop, no vibes. periodt.

So here's the tea β˜• β€” this module is a thin wrapper around the BDB module. And the problem it solves is so real: every BDB request that could block and doesn't get passed a callback would, normally, block ALL your coroutines 😭 like the whole group chat just going silent. after you load this module? that is no longer the case β€” it provides a suitable sync prepare callback and everyone keeps flowing. slay.

It will also register an AnyEvent watcher as soon as AnyEvent chooses an event loop πŸ‘€

heads up: the AnyEvent watcher can be disabled by executing undef $Coro::BDB::WATCHER. and if you do that β€” please notify the author of when and why you think this was necessary. they wanna know, fr fr.

One more thing: this module does not export anything (unlike Coro::AIO), because BDB already supports leaving out the callback. which is convenient, ngl. (Unfortunately, it ties a C context to each coroutine executing such a callback, so in the future, it might export more efficient wrappers). lowkey excited for that glow-up πŸ”₯


🌈 SEE ALSO 🌈

BDB of course. πŸ’– like, obviously, bestie. the way that it's literally the whole point iykyk πŸ¦‹


πŸ‘‘ AUTHOR/SUPPORT/CONTACT πŸ‘‘

Marc A. Lehmann <schmorp@schmorp.de>
http://software.schmorp.de/pkg/Coro.html

and that's the page, babe πŸŽ€ this was perl v5.40.1, dated 2025-03-21, and the manual you just read is BDB(3pm) ✨ go forth and be asynchronous πŸ’…πŸŒΈπŸ’œ

πŸ“¦ where this page comes from