/*
* call-seq:
* conn.consume_input()
*
* If input is available from the server, consume it.
* After calling +consume_input+, you can check +is_busy+
* or *notifies* to see if the state has changed.
*/
static VALUE
pgconn_consume_input(self)
VALUE self;
{
VALUE error;
PGconn *conn = get_pgconn(self);
/* returns 0 on error */
if(PQconsumeInput(conn) == 0) {
error = rb_exc_new2(rb_ePGError, PQerrorMessage(conn));
rb_iv_set(error, "@connection", self);
rb_exc_raise(error);
}
return Qnil;
}