PubSub integration for real-time publishing updates.
Provides broadcasting and subscription for post changes, enabling live updates across all connected admin clients.
Features
- Post lifecycle events (create, update, delete, status change)
- Collaborative editing with real-time form state sync
- Owner/spectator model for concurrent editing
Summary
Functions
Broadcasts bulk operation completion.
Broadcasts bulk operation progress.
Broadcasts that the cache state has changed (file regenerated, memory loaded, etc).
Broadcasts detailed cache operation info.
Broadcasts a form state change to all subscribers.
Broadcasts that a user started editing a post.
Broadcasts that a user stopped editing a post.
Broadcasts that a post was saved, so other editors can reload from disk.
Broadcasts a sync request for new joiners to get current state.
Broadcasts a sync response with current form state.
Broadcasts a group created event.
Broadcasts a group deleted event.
Broadcasts a group updated event.
Broadcasts that legacy structure migration has completed.
Broadcasts legacy structure migration progress.
Broadcasts that legacy structure migration has started.
Broadcasts a post created event.
Broadcasts a post deleted event.
Broadcasts a post status changed event.
Broadcasts a post updated event.
Broadcasts that a new version was created for a post (to post-level topic).
Broadcasts that a version was deleted from a post (to post-level topic).
Broadcasts that the live/published version changed (to post-level topic). Includes source_id so receivers can ignore their own broadcasts.
Broadcasts that primary language migration has completed.
Broadcasts primary language migration progress.
Broadcasts that primary language migration has started.
Broadcasts that AI translation has completed (success or partial failure). Sent to both posts_topic (for blog listing) and post_translations_topic (for editor).
Broadcasts that a new translation was created for a post.
Broadcasts that a translation was deleted from a post.
Broadcasts AI translation progress (after each language completes). Sent to both posts_topic (for blog listing) and post_translations_topic (for editor).
Broadcasts that AI translation has started. Sent to both posts_topic (for blog listing) and post_translations_topic (for editor).
Broadcasts that a new version was created for a post.
Broadcasts that a version was deleted from a post.
Broadcasts that the live version changed for a post.
Returns the topic for bulk operation progress.
Returns the topic for cache updates for a specific blog.
Returns the topic for a specific editor form.
Returns the presence topic for tracking editors of a post.
Generates a form key for a post being edited.
Returns the global topic for editor activity across a group. Used by group listing to show who's editing what.
Returns the topic for global group updates (create, delete).
Returns the topic for a specific post's translation updates. This allows all editors of different language versions to receive updates when new translations are added.
Returns the topic for a specific post's version updates. This allows editors to receive notifications when versions are created/deleted.
Returns the topic for a specific blog's posts.
Subscribes to bulk operation progress for a blog.
Subscribes the current process to cache updates for a blog.
Subscribes to collaborative events for a specific editor form.
Subscribes to editor activity for a group (used by group listing).
Subscribes the current process to group updates (creation/deletion).
Subscribes to translation updates for a specific post.
Subscribes to version updates for a specific post.
Subscribes the current process to post updates for a blog.
Unsubscribes the current process from cache updates for a blog.
Unsubscribes from collaborative events for a specific editor form.
Unsubscribes from editor activity for a group.
Unsubscribes the current process from group updates.
Unsubscribes from translation updates for a specific post.
Unsubscribes from version updates for a specific post.
Unsubscribes the current process from post updates for a blog.
Functions
Broadcasts bulk operation completion.
Broadcasts bulk operation progress.
Broadcasts that the cache state has changed (file regenerated, memory loaded, etc).
Broadcasts detailed cache operation info.
Broadcasts a form state change to all subscribers.
Options:
:source- The source identifier to prevent self-echoing
Broadcasts that a user started editing a post.
Broadcasts that a user stopped editing a post.
Broadcasts that a post was saved, so other editors can reload from disk.
The source is the socket.id of the saver, so they don't reload their own save.
Broadcasts a sync request for new joiners to get current state.
Broadcasts a sync response with current form state.
Broadcasts a group created event.
Broadcasts a group deleted event.
Broadcasts a group updated event.
Broadcasts that legacy structure migration has completed.
Broadcasts legacy structure migration progress.
Broadcasts that legacy structure migration has started.
Broadcasts a post created event.
Broadcasts a post deleted event.
Broadcasts a post status changed event.
Broadcasts a post updated event.
Broadcasts that a new version was created for a post (to post-level topic).
Broadcasts that a version was deleted from a post (to post-level topic).
Broadcasts that the live/published version changed (to post-level topic). Includes source_id so receivers can ignore their own broadcasts.
Broadcasts that primary language migration has completed.
Broadcasts primary language migration progress.
Broadcasts that primary language migration has started.
Broadcasts that AI translation has completed (success or partial failure). Sent to both posts_topic (for blog listing) and post_translations_topic (for editor).
Broadcasts that a new translation was created for a post.
Broadcasts that a translation was deleted from a post.
Broadcasts AI translation progress (after each language completes). Sent to both posts_topic (for blog listing) and post_translations_topic (for editor).
Broadcasts that AI translation has started. Sent to both posts_topic (for blog listing) and post_translations_topic (for editor).
Broadcasts that a new version was created for a post.
Broadcasts that a version was deleted from a post.
Broadcasts that the live version changed for a post.
Returns the topic for bulk operation progress.
Returns the topic for cache updates for a specific blog.
Returns the topic for a specific editor form.
The form_key uniquely identifies a post being edited:
- For existing posts: "blog_slug:post_path" or "blog_slug:slug"
- For new posts: "blog_slug:new:language"
Returns the presence topic for tracking editors of a post.
Generates a form key for a post being edited.
The form key includes the language to allow concurrent editing of different translations of the same post.
Examples
generate_form_key("blog", %{path: "blog/my-post/v1/en.phk"})
# => "blog:blog/my-post/v1/en.phk"
generate_form_key("blog", %{slug: "my-post", language: "en"})
# => "blog:my-post:en"
generate_form_key("blog", %{slug: "my-post", language: "en"}, :new)
# => "blog:new:en"
Returns the global topic for editor activity across a group. Used by group listing to show who's editing what.
Returns the topic for global group updates (create, delete).
Returns the topic for a specific post's translation updates. This allows all editors of different language versions to receive updates when new translations are added.
Returns the topic for a specific post's version updates. This allows editors to receive notifications when versions are created/deleted.
Returns the topic for a specific blog's posts.
Subscribes to bulk operation progress for a blog.
Subscribes the current process to cache updates for a blog.
Subscribes to collaborative events for a specific editor form.
Subscribes to editor activity for a group (used by group listing).
Subscribes the current process to group updates (creation/deletion).
Subscribes to translation updates for a specific post.
Subscribes to version updates for a specific post.
Subscribes the current process to post updates for a blog.
Unsubscribes the current process from cache updates for a blog.
Unsubscribes from collaborative events for a specific editor form.
Unsubscribes from editor activity for a group.
Unsubscribes the current process from group updates.
Unsubscribes from translation updates for a specific post.
Unsubscribes from version updates for a specific post.
Unsubscribes the current process from post updates for a blog.