Connection character set.
* public bool $unbuffered = FALSE
Whether to fetch [asynchronous](pq/Connection/: Asynchronous Usage) results in unbuffered mode, i.e. each row generates a distinct pq\Result.
+* public bool $nonblocking = FALSE
+ Whether to set the underlying socket nonblocking, useful for asynchronous handling of writes. See also pq\Connection::flush().
### Connection Information:
* public (readonly) string $db
Default transaction readonlyness for futire pq\Transaction instances.
* public bool $defaultTransactionDeferrable = FALSE
Default transaction deferrability for future pq\Transaction instances.
-
--- /dev/null
+# bool pq\Connection::flush()
+
+Flush pending writes on the connection.
+Call after sending any command or data on a nonblocking connection.
+
+If it returns FALSE, wait for the socket to become read or write-ready.
+If it becomes write-ready, call pq\Connection::flush() again.
+If it becomes read-ready, call pq\Connection::poll(), then call pq\Connection::flush() again.
+Repeat until pq\Connection::flush() returns TRUE.
+
+> ***NOTE:***
+> This method was added in v1.1.0, resp. v2.1.0.
+
+## Params:
+
+None.
+
+## Returns:
+
+* bool, whether everything has been flushed.
+
+## Throws:
+
+* pq\Connection\InvalidArgumentException
+* pq\Connection\RuntimeException when no asynchronous operation is active, or flushing failed
+
+## Example:
+
+ <?php
+ $c = new pq\Connection();
+ $c->nonblocking = true;
+
+ $c->execAsync("SELECT '".str_repeat("a", 6e7)."'", function($r) {
+ $r->fetchCol($s);
+ var_dump(strlen($s));
+ });
+
+ $flushed = $c->flush();
+ do {
+ while (!$flushed || $c->busy) {
+ $r = $c->busy ? [$c->socket] : null;
+ $w = !$flushed ?[$c->socket] : null;
+
+ if (stream_select($r, $w, $e, null)) {
+ if ($r) {
+ printf("P%d", $c->poll());
+ }
+ if ($w) {
+ printf("F%d", $flushed = $c->flush());
+ }
+ }
+ }
+ echo "\n";
+ } while ($c->getResult());
+ ?>
+
+### Yields:
+
+ F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0
+ ... (omitted)
+ F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F1P3P3P3P3P3P3P3P3
+ ... (omitted)
+ P3P3P3P3P3P3P3P3P3P3P3P3P3P3
+ int(60000000)
The number of fields in a single tuple of the result set.
* public (readonly) int $affectedRows
The number of rows affected by a statement.
+* public (readonly) array $diag
+ Error details. See [PQresultErrorField](https://www.postgresql.org/docs/current/static/libpq-exec.html#LIBPQ-PQRESULTERRORFIELD) docs.
* public int $fetchType = pq\Result::FETCH_ARRAY
The [type of return value](pq/Result#Fetch.types:) the fetch methods should return when no fetch type argument was given. Defaults to pq\Connection::$defaultFetchType.
* public int $autoConvert = pq\Result::CONV_ALL