Ben Carey
Ben Carey

Reputation: 16958

Which Ratchet Component to Use

Brief Explanation...

I started working with Ratchet about 6 hours ago so my question my be a little basic... I have an existing website that has a big counter in the middle of one of the pages. The counter represents how many people have signed up to a particular form.

I would like this counter to update immediately whenever a person signs up to the website. In other words, there must be a web socket set up in order to be alerted when a new person has signed up to the site.

My Question

Before I go ahead and attempt to write the code, I would like to know which Ratchet component I should be using. I have gone through the introductions and tutorials and I think I should be using the WAMP Component but I am not 100% sure, and it is also the only tutorial I wasn't able to get working...

In short, which Ratchet Component should I use to update a counter on a website?

Upvotes: 0

Views: 59

Answers (1)

Dominick Navarro
Dominick Navarro

Reputation: 752

It really depends on what you are trying to accomplish

here's what you need to put in mind:

if you are trying to do a simple websocket application that targets simple 1 server to 1 client communication it is good to use the MessageComponentInterface.

but if you like to do a websocket application that would allow you to send from 1 server to multiple clients it is easier to accomplish this with a WAMP Component.

Your decision would depend on what your application requires.

Upvotes: 2

Related Questions