Real-time Phoenix (Pragprog)

The book is great! Feedback: in Chapter 6 show how to instrument channels with Telemetry / Telemetry Poller (or at least mention it!)

2 Likes

Thanks a lot for considering my request. By the way I recommend your book to everyone building RTS in Phoenix.

2 Likes

When will this book be available on Safari Books?

I need to understand the Telemetry chapter and the authentication with Channels

Pragmatic Programmers Beta books are not available on Safari. You’ll have to wait until the book gets to version P1.0 (production).

1 Like

I spent an hour reading this morning, I am really enjoying the writing style of @sb8244. Looking forward to sitting down again to read more.

2 Likes

Hi, I understand.

But this book as well as https://pragprog.com/book/phoenix14/programming-phoenix-1-4
and also https://pragprog.com/book/jgotp/designing-elixir-systems-with-otp
is in Beta.

The community is growing and taking interest. I wish at-least one of these(latest version) was available now on Safari Books. :slight_smile:

Well, you’ll be pleased to know

recently went to production. So, you’ll see it on Safari soon.

Also, if you can, you should consider buying books while they’re in Beta. Not only you’ll get early access at a good price, but you’ll be supporting the authors to write even more for us :slightly_smiling_face:

4 Likes

Blockquote I’m going to think about how to approach this. I don’t think I’m equipped to add examples of using it with Elm, but I may be able to provide something for VueJs and friends. A lot of it will have to do with timing and my availability.

I hope it would be VueJS :smiley:

3 Likes

React would be awesome. Just got the book, excited!

Hey y’all. The third beta just released with chapter 9.

We build a user-specific shopping cart in this chapter—It’s the most advanced usage of Channels in the book and covers many of the challenges seen in past chapters. Also, there’s cool shoe images now (but I can’t upload a screenshot right now for some reason)!

Chapter 10 is in the queue as well—it should be a fast follow. That chapter will cover Tracker / Presence to build an admin dashboard.

3 Likes

Hi folks,
Is anyone working through the code in the book? I have started but am having limited success. Since Pragprog does not allow discussions, would this be the place to share thoughts? I’m on page 34 and getting unmatched topic warnings:

> $ wscat -c 'ws://localhost:4000/socket/websocket?vsn=2.0.0'
> Connected (press CTRL+C to quit)
> > ["1","1","ping","phx_join",{}]
> < [null,"1","ping","phx_reply",{"response":{"reason":"unmatched topic"},"status":"error"}]
> Disconnected (code: 1000)

Mike

1 Like

Hey Mike

Did you add the channel to the UserSocket on page 32? A complete code for hello_sockets distributes with the book and may help here.

3 Likes

Thanks for the quick response, Steve. I restarted my server, and it picked up the channel. Getting a correct response now. I shall forge ahead. Running on Manjaro linux with Firefox Developer beta. The messages tab in the dev tools view is not working so far.

2 Likes

FYI, I moved to the unstable branch and the messages tab works in 71.0b7 of Firefox Developer.

1 Like

Thanks for sharing. I’m honestly not sure what’s up with this. I have been using Chrome exclusively, and I originally checked in Firefox that this all worked as expected. I’m glad it’s working in the latest version (although not main yet).

Chrome recently had some weird WebSocket issues as well.

1 Like

Thanks for writing this book! I’ve been waiting for one like this for awhile now.

4 Likes

We shipped chapter 10 to beta, and 11-13 are in editor review. 10 is about using Tracker/Presence. We build an admin UI for the store and use Presence for knowing how many of each shoes are in carts.

Chapter 13 is a LiveView chapter (it wasn’t in the original ToC as we were working out how to include it).

4 Likes

Thanks for releasing part 2 of the book.

I would like to ask You if using one product channel, instead of one channel per product is also a viable option. Each message being tagged with product_id.

I do understand it solves different problems, but my concern is about the number of products, and thus, the numbers of channels You need to open (for a catalog that could 10k-100k products).

Thanks for taking time.

1 Like

Definitely! The reason I went with the multi channel approach is to hide information a bit. Also, to reduce the number of messages going out to users.

Let’s say that you have 1000 products represented by a single topic. If any of those products would change, every current visitor would receive the message. This could end up being a lot of additional data transfer in a high traffic store. It’s all a trade-off though. It’s arguably a simpler design and so development and maintenance efforts will be less. Many people would opt for this.

I don’t think either solution is wrong unless it proves itself to not work in the context of what you’re doing.

1 Like

Alright, a little update.

The deployment chapter (11) just went into beta. There’s some neat stuff to think about with load balancing here. Part III will be fairly standalone and you could read it without the rest of the book if you want.

The next 2 chapters (Managing Production Resources and Hands-On With Phoenix LiveView) are going to be releasing soon, although the holidays may delay them a bit.

We’re adding another chapter on single-page apps. I’m probably going to focus on React only here because the important part is using a component based library, and also React works with Native. I haven’t fully decided yet. The React example will probably be standalone though, and not tied into the rest of the book’s example.

- Steve

3 Likes