flightaware / Pgtcl

Tcl client side interface to PostgreSQL (libpgtcl)
https://flightaware.github.io/Pgtcl/
BSD 3-Clause "New" or "Revised" License
31 stars 10 forks source link

Integrate asynchronous queries with TCL events #36

Open dmichal opened 4 years ago

dmichal commented 4 years ago

Currently, to execute query in an asynchronous manner, one has to send it by calling pg_sendquery and later consequently poll the connection with pg_isbusy. In my opinion this could be improved by taking advantage of the TCL event mechanism. What comes to my mind is defining callback to be executed after receiving some data on the socket; pg_isbusy could then be called from the callback script instead of being called blindly in a loop.