Skip to main content

Module cursor

Module cursor 

Source
Expand description

Cursor persistence for Jetstream consumer.

Stores the last processed event timestamp (time_us) so the consumer can resume from where it left off after restart.

Constants§

CREATE_CURSOR_TABLE_POSTGRES
SQL for creating the cursor table (PostgreSQL).
CREATE_CURSOR_TABLE_SQLITE
SQL for creating the cursor table (SQLite).

Functions§

ensure_cursor_table
Ensure the cursor table exists for the active backend.
load_cursor
Load the last stored cursor for a consumer. Returns None if no cursor has been stored yet.
save_cursor
Save the cursor position for a consumer.