Mojolicious does not use threads, but it does use event-driven callbacks. Maybe that's what you meant? It is true that you can't use regular DBI methods for the queries if you are expecting to respond to event-driven requests. However, I don't think SQLite can be event-driven anyway, because it is a library that runs in your own thread rather than acting like a server which you could asynchronously exchange events with.
That said, Mojo doesn't *need* to be used event-driven. You can run a pre-forked worker pool of Mojo app processes just like any of the other frameworks. In this mode, you just use DBI like normal. But, if you want to make use of Websockets, you do need the event-driven style and an event-driven server like Twiggy.
For Mojo to asynchronously talk to a database and respond to events when the queries complete, while processing other requests in the meantime, you need to use the custom database connectors like Mojo::Pg, and use the promise-returning methods like query_p.
In reply to Re: Database access and async web framework (like Mojolicious)
by NERDVANA
in thread Database access and async web framework (like Mojolicious)
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |