Replies: 1 comment
-
|
The MongoDB PHP extension contains roughly 300,000 lines of code—about three times the size of Swoole’s—and follows a rich‑client design with a large amount of logic implemented on the client side. By contrast, other databases often need only a small, fixed set of PDO APIs for executing SQL, which makes adapting them to asynchronous, non‑blocking I/O relatively straightforward. As far as I know, all MongoDB client libraries across programming languages are maintained by MongoDB itself; there are no third‑party client drivers. If asynchronous support is required, the request should be taken up with the MongoDB team for them to implement. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I had a few questions about coroutines I was hoping to get help with:
I believe that the PHP MongoDB library (https://github.com/mongodb/mongo-php-driver) does not work with coroutines and causes them to block. Is that correct?
Is there a way to test/benchmark if other libraries in PHP do not work with coroutines either? I use a few other 3rd party extensions that I'm not sure about, so I was hoping there was a way I could write a script with them to determine if they work with coroutines or not.
Are there ways to call the PHP MongoDB library from within a coroutine such as task workers? If yes, could you point me to an example of a http server in swoole that calls a task worker upon each request and waits for the result to send back to the user?
Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions