Putting LMDB on the Web
Although we won’t be introducing any new LMDB functions as we integrate with our libuv-based framework, we should review a few fine points of the API before we start writing code. In particular, we need to know in what circumstances LMDB will block; if we inadvertently block the event loop, a single bad or expensive input can cause our whole server to stop processing requests.
Essentially, the only time we have to worry about LMDB blocking is when we create a transaction and open a database. If another transaction has locked that database, mdb_dbi_open won’t return until the lock is released. And because transactions can run as much Scala Native code as they like, this would have the potential to block our program more ...
Get Modern Systems Programming with Scala Native now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.