All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mle.play.ws.TrieClientStorage.scala Maven / Gradle / Ivy

The newest version!
package com.mle.play.ws

import scala.collection.concurrent.TrieMap

/**
 * @author Michael
 */
trait TrieClientStorage extends WebSocketBase {
  protected val clientsMap = TrieMap.empty[Client, Unit]

  override def clients = clientsMap.keys.toSeq

  override def onDisconnect(client: Client): Unit = {
    clientsMap -= client
    //    if (clients.size == 0) {
    //      onNoClients()
    //    }
  }

  override def onConnect(client: Client): Unit = {
    clientsMap += client ->()
    //    if (clients.size == 1) {
    //      onFirstClient()
    //    }
  }

  //  def onFirstClient(): Unit = ()
  //
  //  def onNoClients(): Unit = ()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy