Open romank0 opened 1 year ago
I have an implementation of this but it depends and is based on PRs that are not yet merged https://github.com/Opus10/django-pgpubsub/pull/66 and https://github.com/Opus10/django-pgpubsub/pull/73 and there might be some amendments to the approach there so I'll add a PR for this when it will be clear what migration path will be chosen there.
Currently for the updated django entity that has an associated
TriggerChannel
the notification payload is sent via postgresNOTIFY
and it contains the old and the new serialized entity state. On the listener the payload sent via postgres channel is used only to find the appropriateNotification
record from the DB and then the payload from the record is used.This sending of the complete payload is suboptimal:
old
andnew
records are sent that size is rather smallThe better solution seems to be to send only the notification ID for the
TriggerChannel
that has a persistent notifications.