Written words that are often helpful

A quick note about Phoenix Framework Channels

Posted by chathaway on Aug. 19, 2017, 11:54 p.m.

Just a quick note which frustrated me quite a bit on Thursday; intercepting messages (which should call handle_out) in Phoenix Framework's channels does not cause the handler to get called if you are using "send" instead of broadcast.

I suppose this actually makes sense, since you wouldn't want to stuck in an infinite loop (filtering a send, which sends something), but it wasn't obvious why Phoenix was ignoring my handle_out function. Almost like it wasn't detecting the itnercept() parameters.

A solution may be to add documentation about handle_out to the callbacks section of the Channels module API, specifically informing the user that they can't do that.

Banner Image © 2017 Ranjani Hathaway | Content © 2017 Charles Hathaway PDF