summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorMartins Grunskis <martins@grunskis.com>2018-10-29 09:50:31 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2019-03-30 21:23:11 +0000
commitf946042a79fc340d249589ff6acb8fdcb671e9f1 (patch)
tree559d5324728f0d7d35db82316a2c47f950c2ca67 /doc/src
parent3eecf34beaa0fa2deea9f22baf3b657db412a404 (diff)
downloadpsycopg2-f946042a79fc340d249589ff6acb8fdcb671e9f1.tar.gz
Store WAL end pointer in the replication cursor
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/extras.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/src/extras.rst b/doc/src/extras.rst
index 13bd1bb..e203660 100644
--- a/doc/src/extras.rst
+++ b/doc/src/extras.rst
@@ -481,6 +481,12 @@ The individual messages in the replication stream are represented by
communication with the server (a data or keepalive message in either
direction).
+ .. attribute:: wal_end
+
+ LSN position of the current end of WAL on the server at the
+ moment of last data or keepalive message received from the
+ server.
+
An actual example of asynchronous operation might look like this::
from select import select
@@ -500,7 +506,7 @@ The individual messages in the replication stream are represented by
try:
sel = select([cur], [], [], max(0, timeout))
if not any(sel):
- cur.send_feedback() # timed out, send keepalive message
+ cur.send_feedback(flush_lsn=cur.wal_end) # timed out, send keepalive message
except InterruptedError:
pass # recalculate timeout and continue