Closed akarelas closed 2 years ago
The current tests are the best tests I can write for this PR. Apologies, and please advise how to improve if they are not enough.
I wonder if I should have left the timers in the tests.
Should I have left the timers in the test? I can revert back to that, if you want.
If you want someone to review your work in progress PR you have to make sure you make it clear that it is now ready for review.
Summary
This PR adds a
$pubsub->db->_notifications
call at the end of$pubsub->db->listen
and$pubsub->db->unlisten
, which should exist there as these two methods issue blocking SQL operations.Motivation
Without these changes, a
$pubsub->listen
on a new channel that directly follows a$pg->db->notify
on one we're already listening on, would cause that notification to not be received in a timely manner (but potentially a lot later). I wanted to fix this.References
This PR fixes issue #77.