'elixir phoenix pubsub wildcard topic
when using phoenix pubs directly is there a way for subscribing to a topic with partial match, e.g. something like "user:*"?
just for illustration sake, the following code:
Phoenix.PubSub.subscribe("my_pubsub", "user:*")
should match all the following events:
Phoenix.PubSub.broadcast("my_pubsub", "user:123", "banana")
Phoenix.PubSub.broadcast("my_pubsub", "user:911", "apple")
Phoenix.PubSub.broadcast("my_pubsub", "user:", "orange")
Solution 1:[1]
Phoenix.PubSub.subscribe does not support wildcard topics. As noted in the Phoenix Docs, and by this answer by Chris McCord, channels and topics can have wildcards in the strings, but subscriptions cannot.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | DogEatDog |
