tim2CF
Phoenix pubsub asterisk symbol support?
Let’s say we have a code
iex(1)> Phoenix.PubSub.subscribe Foo.PubSub, "user:*"
:ok
iex(2)> :erlang.process_info(self, :messages)
{:messages, []}
iex(3)> Phoenix.PubSub.broadcast Foo.PubSub, "user:1", :foo
:ok
iex(4)> :erlang.process_info(self, :messages)
{:messages, []}
Looks like phoenix_pubsub does not support asterisk symbol - "user:*" or "user.*" not worked for me. Is there any fundamental reason why it don’t support this functionality? Will be very useful for models/topics with big amount of fields (where amount of possible permutations is huge) like "user.*.currency.BTC.country.*"
Most Liked
benwilson512
Author of Craft GraphQL APIs in Elixir with Absinthe
easco
I believe the ability to use the * wildcard is a feature of Phoenix Channels, and not built into the PubSub system itself. When creating a channel you can tell Phoenix that you want a particular Channel module to handle all the broadcast messages matching a particular pattern, but I don’t think you can subscribe to a PubSub with wildcards.
1
Popular in Questions
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum.
...
New
I would like to know what is the best IDE for elixir development?
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
Other popular topics
Update:
How to use the Blogs & Podcasts section
You can post links to your blog posts or podcasts either in one of the Official Blog...
New
Hi!
In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir?
Searched the docs for ip address and the web, no good results.
Thanks!
New
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set?
Thanks.
New
I have an umbrella app.
Some of the apps inside depend on other apps in the umbrella, unsurprisingly.
I’m writing a test for one of the...
New
Hi everyone!
I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









