redis icon indicating copy to clipboard operation
redis copied to clipboard

multiple subscription issue

Open mohsenShakiba opened this issue 9 years ago • 0 comments

I need to subscribe to a pattern and to a normal channel, here is my code

client_sub = getRedisSub()
client_sub |> Exredis.Sub.subscribe "status", fn(msg) ->
  case msg do
    {:message, _, groupID, _} -> RedisActions.onSendMessageToMembersOf(groupID)
    _ -> IO.inspect msg
  end
end

client_sub |> Exredis.Sub.psubscribe "message:*", fn(msg) ->
  Message.parse_redis_message(msg)
end

but the problem is only one of them will receive the published events, whichever that comes first. what am I doing wrong?

mohsenShakiba avatar Jun 19 '16 07:06 mohsenShakiba