-
Notifications
You must be signed in to change notification settings - Fork 131
Refactor listen/notify as a pubsub backend #6811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
d976358
to
346574b
Compare
f25b950
to
6a9000d
Compare
self.sentinel_r, self.sentinel_w = os.pipe() | ||
os.set_blocking(self.sentinel_r, False) | ||
os.set_blocking(self.sentinel_w, False) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
aea9033
to
5e71216
Compare
6389b3a
to
a04fa6a
Compare
a04fa6a
to
a508837
Compare
This reverts commit 6e6879c.
a508837
to
cecf943
Compare
No description provided.