{"action":"created","issue":{"url":"https://api.github.com/repos/stefanwille/crystal-redis/issues/43","repository_url":"https://api.github.com/repos/stefanwille/crystal-redis","labels_url":"https://api.github.com/repos/stefanwille/crystal-redis/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/stefanwille/crystal-redis/issues/43/comments","events_url":"https://api.github.com/repos/stefanwille/crystal-redis/issues/43/events","html_url":"https://github.com/stefanwille/crystal-redis/issues/43","id":259944540,"number":43,"title":"#psubscribe subscription callback not called","user":{"login":"danielwestendorf","id":44478,"avatar_url":"https://avatars2.githubusercontent.com/u/44478?v=4","gravatar_id":"","url":"https://api.github.com/users/danielwestendorf","html_url":"https://github.com/danielwestendorf","followers_url":"https://api.github.com/users/danielwestendorf/followers","following_url":"https://api.github.com/users/danielwestendorf/following{/other_user}","gists_url":"https://api.github.com/users/danielwestendorf/gists{/gist_id}","starred_url":"https://api.github.com/users/danielwestendorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielwestendorf/subscriptions","organizations_url":"https://api.github.com/users/danielwestendorf/orgs","repos_url":"https://api.github.com/users/danielwestendorf/repos","events_url":"https://api.github.com/users/danielwestendorf/events{/privacy}","received_events_url":"https://api.github.com/users/danielwestendorf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-22T21:37:40Z","updated_at":"2017-09-23T14:22:09Z","closed_at":"2017-09-23T14:22:09Z","author_association":"NONE","body":"I'm unsure if this is a bug or just improper usage of the library. I can `#subscribe` to a channel without issue. However, when I try to use `#psubscribe` the subscription callback never is called. What am I doing wrong?\r\n\r\n```crystal\r\nrequire \"redis\"\r\nredis = Redis.new\r\n\r\nredis.psubscribe(\"channel.*\") do |on|\r\n  on.message do |channel, message|\r\n    puts \"I got a message\"\r\n  end\r\nend\r\n```\r\n\r\n```sh\r\n$ crystal run src/psubscribe.cr\r\n^\r\n```\r\n\r\n```sh\r\n$ redis-cli\r\n127.0.0.1:6379> PSUBSCRIBE channel.*\r\nReading messages... (press Ctrl-C to quit)\r\n1) \"psubscribe\"\r\n2) \"channel.*\"\r\n3) (integer) 1\r\n1) \"pmessage\"\r\n2) \"channel.*\"\r\n3) \"channel.abc\"\r\n4) \"hello\"\r\n```\r\n\r\n```sh\r\n$ redis-cli\r\n127.0.0.1:6379> PUBLISH channel.abc hello\r\n(integer) 1\r\n127.0.0.1:6379>\r\n```\r\n\r\n```\r\n$ crystal --version\r\nCrystal 0.23.1 (2017-09-08) LLVM 4.0.1\r\n```\r\n```yml\r\n  redis:\r\n    github: stefanwille/crystal-redis\r\n    version: 1.9.0\r\n```"},"comment":{"url":"https://api.github.com/repos/stefanwille/crystal-redis/issues/comments/331638903","html_url":"https://github.com/stefanwille/crystal-redis/issues/43#issuecomment-331638903","issue_url":"https://api.github.com/repos/stefanwille/crystal-redis/issues/43","id":331638903,"user":{"login":"danielwestendorf","id":44478,"avatar_url":"https://avatars2.githubusercontent.com/u/44478?v=4","gravatar_id":"","url":"https://api.github.com/users/danielwestendorf","html_url":"https://github.com/danielwestendorf","followers_url":"https://api.github.com/users/danielwestendorf/followers","following_url":"https://api.github.com/users/danielwestendorf/following{/other_user}","gists_url":"https://api.github.com/users/danielwestendorf/gists{/gist_id}","starred_url":"https://api.github.com/users/danielwestendorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielwestendorf/subscriptions","organizations_url":"https://api.github.com/users/danielwestendorf/orgs","repos_url":"https://api.github.com/users/danielwestendorf/repos","events_url":"https://api.github.com/users/danielwestendorf/events{/privacy}","received_events_url":"https://api.github.com/users/danielwestendorf/received_events","type":"User","site_admin":false},"created_at":"2017-09-23T14:22:09Z","updated_at":"2017-09-23T14:22:09Z","author_association":"NONE","body":"This was a usage issue. After looking at the specs, the API for listening to `#psubscribe` is different.\r\n\r\nI've created a [PR](https://github.com/stefanwille/crystal-redis-examples/pull/3) with an example for `#psubscribe` to the examples repo. "}}
{"actor":{"display_login":"danielwestendorf"}}