-
Notifications
You must be signed in to change notification settings - Fork 59
Description
I read recently that PostgresSql supports durable pub/sub
I'm wondering if this is useful for our projections to avoid polling event streams directly ...
The mechanism is relatively simple: When creating a stream or appending to it we could use NOTIFY to indicate that new events are available.
Running projections can use pg_get_notify to check for new notifications and only query effected event streams if new events are available.
pg_get_notify still uses polling, so I'm not sure if it is worth the effort. I also checked amphp but they use pg_get_notify, too. But an AmphpProjectionManager would be nice so that a single non-blocking Postgres connection is shared between multiple projections. But that's a different story.
Thoughts @prolic @basz @sandrokeil @oqq @shochdoerfer ?
@shochdoerfer Do you use that feature or do you know someone who uses it?