Skip to content

Conversation

pedro-psb
Copy link
Member

No description provided.

@pedro-psb pedro-psb force-pushed the tasking/add-pubsub-interface branch from d976358 to 346574b Compare July 30, 2025 00:58
@pedro-psb pedro-psb linked an issue Jul 30, 2025 that may be closed by this pull request
@pedro-psb pedro-psb force-pushed the tasking/add-pubsub-interface branch 3 times, most recently from f25b950 to 6a9000d Compare July 31, 2025 19:20
Comment on lines +73 to +75
self.sentinel_r, self.sentinel_w = os.pipe()
os.set_blocking(self.sentinel_r, False)
os.set_blocking(self.sentinel_w, False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really related? I thought this os.pipe was primarily part of the select calls to receive the signals like SIGINT, SIGTERM.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this to make the semantics of the PubSub readiness tied to the data it actually stores, which is the self.message_buffers queue (not the connection buffer). If I just use connection.connection, test_pubsub:111 fails as the pg_notify_callback is called automatically on same-process connections and is empty at this point.

But I don't feel very good about how complex this looks. I think using notifies may make our lives easier

@pedro-psb pedro-psb force-pushed the tasking/add-pubsub-interface branch 4 times, most recently from aea9033 to 5e71216 Compare August 5, 2025 17:27
@pedro-psb pedro-psb marked this pull request as ready for review August 5, 2025 17:27
@pedro-psb pedro-psb marked this pull request as draft August 5, 2025 17:28
@pedro-psb pedro-psb marked this pull request as ready for review August 5, 2025 18:06
@pedro-psb pedro-psb force-pushed the tasking/add-pubsub-interface branch 2 times, most recently from 6389b3a to a04fa6a Compare August 6, 2025 13:15
@pedro-psb
Copy link
Member Author

Here is one of the general ideas for why I prefer to not add a callback into the pubsub interface (the other is testability).

image image

@pedro-psb pedro-psb force-pushed the tasking/add-pubsub-interface branch from a04fa6a to a508837 Compare August 6, 2025 14:21
@pedro-psb pedro-psb marked this pull request as draft September 25, 2025 13:44
@pedro-psb pedro-psb force-pushed the tasking/add-pubsub-interface branch from a508837 to cecf943 Compare September 25, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generalize listen/notify as a pubsub backend
2 participants