class PG::Connection
def async_api=(enable)
Any issues with the default setting of async_api=true should be reported to the maintainers instead.
Do not use this method in production code.
_PLEASE_ _NOTE_: This method is not part of the public API and is for debug and development use only.
pg-1.3.0+ defaults to libpq's async API for all possibly blocking methods.
pg-1.1.0+ defaults to libpq's async API for query related blocking methods.
sets an alias from #exec to #sync_exec, #reset to #sync_reset and so on.
PG::Connection.async_api = false
It sets an alias from #exec to #async_exec, #reset to #async_reset and so on.
this is the default.
PG::Connection.async_api = true
Switch between sync and async libpq API.
def async_api=(enable) self.async_send_api = enable REDIRECT_METHODS.each do |ali, (async, sync)| remove_method(ali) if method_defined?(ali) alias_method( ali, enable ? async : sync ) end REDIRECT_CLASS_METHODS.each do |ali, (async, sync)| singleton_class.remove_method(ali) if method_defined?(ali) singleton_class.alias_method(ali, enable ? async : sync ) end end