Skip to content

Add tagged subscriptions - #217

Open
SteffenDE wants to merge 1 commit into
mainfrom
sd-tagging
Open

Add tagged subscriptions#217
SteffenDE wants to merge 1 commit into
mainfrom
sd-tagging

Conversation

@SteffenDE

Copy link
Copy Markdown
Member

This is meant for situations where one process subscribes to the same topic multiple times independently and wants to differentiate the different subscriptions - or - a process subscribes to two different topics that share the same message format and wants to differentiate the topics.

In this case, it can now add a tag when subscribing and messages will arrive as {tag, message} instead of message, assuming the default dispatcher is used or the custom dispatcher handles tagging.

This is meant for situations where one process subscribes to the same
topic multiple times independently and wants to differentiate the different
subscriptions - or - a process subscribes to two different topics that share
the same message format and wants to differentiate the topics.

In this case, it can now add a tag when subscribing and messages will arrive
as `{tag, message}` instead of `message`, assuming the default dispatcher is
used or the custom dispatcher handles tagging.
Comment thread lib/phoenix/pubsub.ex
end

@doc """
Applies a subscription's tag to `message`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this? Custom dispatchers could just implement their own tags themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants