Skip to content

Listen/Notify for readStream#428

Merged
devhawk merged 7 commits into
mainfrom
devhawk/listen-stream
Jun 10, 2026
Merged

Listen/Notify for readStream#428
devhawk merged 7 commits into
mainfrom
devhawk/listen-stream

Conversation

@devhawk

@devhawk devhawk commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Replaces the 1-second Thread.sleep polling loop in StreamIterator with PostgreSQL LISTEN/NOTIFY, so stream readers wake immediately when a new value is inserted. The 1-second poll is retained as a fallback timeout and for use when LISTEN/NOTIFY is not available (like CRDB)

A previous PR added Migration 39 which adds the trigger that fires pg_notify('dbos_streams_channel', workflow_uuid || '::' || key) on every INSERT to the streams table. This PR wires up the reader side.

fixes #401

@devhawk devhawk requested review from kraftp, maxdml and qianl15 June 10, 2026 04:55
Comment thread transact/src/main/java/dev/dbos/transact/database/dao/StreamsDAO.java Outdated
@devhawk devhawk requested a review from kraftp June 10, 2026 19:42
@devhawk devhawk merged commit 5722672 into main Jun 10, 2026
18 checks passed
@devhawk devhawk deleted the devhawk/listen-stream branch June 10, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Listen/Notify in Streams

2 participants