edwardyoon / heimdallr

Heimdallr, a Large-scale chat application server based on Redis Pubsub and Akka's actor model.
Apache License 2.0
54 stars 14 forks source link

Implement getNumOfClients() #24

Closed edwardyoon closed 5 years ago

edwardyoon commented 5 years ago

It'd be nice if we can get number of total clients in single chatroom on distributed machines like below:

/**
 * returns the number of total clients in chatroom of given id.
 */
 def getNumOfClients(int chatRoomID)

My simple idea is using Redis's INCR (https://redis.io/commands/incr). We can in/decrement the count when WebSocket connection is established.