alaisi / postgres.async

Asynchronous PostgreSQL client for Clojure
Eclipse Public License 1.0
137 stars 9 forks source link

Timeouts? #16

Open donbonifacio opened 9 years ago

donbonifacio commented 9 years ago

Is there a way to specify timeouts?

alaisi commented 9 years ago

Short answer: Currently no.

Long answer: What timeouts are you referring to? You can of course use core.async (timeout) and (alts!) but there is currently no way to cancel a running query. Cancelation is a fairly heavy operation as it means opening a new physical connection to the postgresql server.

donbonifacio commented 9 years ago

Doesn't postgres have something for timeouts? For example, any operation that takes longer than 1s would be canceled/timedout by postgres.

I could use core.async's timeout, but mixing that with insert/update operations is not that advised.