Generic async plugin

1 Relevant Page: Plugins
glebs 9 months ago

My application require to run some custom command line utility, and read some data from it. In general case, this task is usually performed with popen, but popen is synchronous. Yes, it is possible to switch popen's i/o to async mode, but I need to bind unix sockets used by popen with trantor's event loop, and to register i/o completion callback. How to do this with Drogon and Trantor?

antao2002 9 months ago

Yes, you are right. You could refer to the PgConnection class in orm_lib which implements an async connection to the postgresql server. The core component of it is the trantor::Channel object with it users register their i/o completion callbacks.

Log in to comment