pm9999

pm9999

Web Development with Clojure, Third Edition: missing methods (page 191)

Finally, we can remove our handle-message method for :chsk/ws-ping, since we’re
handling it directly from receive-message! now.

This hints that :chsk/ws-ping was defined earlier in websockets.clj. As far as I can tell only websockets.cljs has :chsk/handshake and :chsk/state defined on page 150 but nothing for websockets.clj on page 146 and page 147. Perhaps :chsk/ws-ping was missed for both clj/cljs and the clj was also missing handshake/state methods.

First Post!

svmbrown

svmbrown

Author of Web Development with Clojure

It does seem that :chsk/ws-ping implementation is never referenced in the book. We must have overlooked it, sorry about that. It is in the code for the book here: guestbook.routes.websockets if you’re curious.

The :chsk/ws-ping message can be safely ignored, since it is just a keep-alive ping. Our default handler should do a suitable job of ignoring it.

However, the :chsk/handshake and :chsk/state messages are handled by sente itself, and notify our client of any changes to its state. The server will never receive messages of this type, and therefore doesn’t need handlers for them.

Where Next?

Popular Pragmatic Bookshelf topics Top

jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
New
New
jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
johnp
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
New
ianwillie
Hello Brian, I have some problems with running the code in your book. I like the style of the book very much and I have learnt a lot as...
New
jamis
The following is cross-posted from the original Ray Tracer Challenge forum, from a post by garfieldnate. I’m cross-posting it so that the...
New
New
mert
AWDWR 7, page 152, page 153: Hello everyone, I’m a little bit lost on the hotwire part. I didn’t fully understand it. On page 152 @rub...
New
New
SlowburnAZ
Getting an error when installing the dependencies at the start of this chapter: could not compile dependency :exla, "mix compile" failed...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1032 17402 381
New
AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New

Sub Categories: