Hacker News new | ask | show | jobs
by PaulHoule 912 days ago
You know I have a lot of fun writing asyncio servers in Python for web applications or servers that are simultaneously connected to message queues, web sockets, and other things.

Whenever I talk about them people ask me "are you crazy man?" in that most teams struggle to maintain asyncio servers and if it was just a web server I might consider using Flask if I am planning to hand off the code to anybody but Jane Street. To absolutely avoid blocking the event loop any heavy computation has to be outsourced to something that is more or less a "microservice" which opens the question of are those services aio? are they even written in Python? I'd think of moving everything but the machine learning to the JVM.

That said, my take is that it is not difficult for a database driver or API client to support sync and async because the structure of almost all calls is the same (marshal parameters, make the network call, unmarshal results) so with a little bit of metaprogramming you can build out both implementations from the same source.