Channel member count

32 views
Skip to first unread message

Pete Forde

unread,
Jul 7, 2012, 5:20:33 PM7/7/12
to Bridge
I'm just starting to play with Bridge, and I'm trying to move away
from the simple chat server/client example to get a handle on the
concepts.

I've set two goals for my experiment:

1. Display a count of how many visitors are connected in realtime.
2. Update a text value on all connected clients when it changes on the
server.

So far, getting the clients to join a channel and reflect a text value
was straight forward. However, if there's a way to query the number of
active clients, or even set up a callback to fire when someone joins
or leaves a channel, that would seem to open up a lot of
opportunities.

I can have clients increment a counter when they join a channel, but
there's obviously no guarantee that they will notify the server when
they leave.

If I'm thinking about this wrong, I'm happy to get schooled in the
correct pattern of thought on this matter.

Pete

Darshan Shankar

unread,
Jul 7, 2012, 5:23:16 PM7/7/12
to bridge...@googlegroups.com
You're right. The API needs to be able to show which clients/how many clients are connected to a channel. We're working on it, but it'll take time to properly implement this (and the other API features) in all the clients.

In the meantime, as you mentioned, counter incrementing on joinChannel is the best temporary way.


Pete

--
You received this message because you are subscribed to the Google Groups "Bridge" group.
To post to this group, send email to bridge...@googlegroups.com.
To unsubscribe from this group, send email to bridge-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bridge-users?hl=en.




--
Darshan Shankar

Pete Forde

unread,
Jul 7, 2012, 8:29:27 PM7/7/12
to Bridge
Thanks for your reply, Darshan!

For what it's worth, I think I am looking for something along the
lines of Pusher's Presence channels:

http://pusher.com/docs/client_api_guide/client_presence_channels

I know that you folks have your work cut out for you, so I will be
patient. :)

Pete
> @dshankar <http://twitter.com/dshankar> -
> @getbridge<http://twitter.com/getbridge>
> getbridge.com <http://www.getbridge.com/>

Gatukrig

unread,
Aug 11, 2012, 7:47:45 PM8/11/12
to bridge...@googlegroups.com
Yes this would help alot.
Reply all
Reply to author
Forward
0 new messages