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

io.udash.rpc.utils.DefaultAtmosphereFramework.scala Maven / Gradle / Ivy

There is a newer version: 0.2.0-rc.3
Show newest version
package io.udash.rpc.utils

import io.udash.rpc.{AtmosphereService, AtmosphereServiceConfig, RPC}
import org.atmosphere.cpr.{ApplicationConfig, AtmosphereFramework}

/** AtmosphereFramework with default configuration for Udash. */
class DefaultAtmosphereFramework(config: AtmosphereServiceConfig[_ <: RPC]) extends AtmosphereFramework {
  addAtmosphereHandler("/*", new AtmosphereService(config))
  addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true")
  addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true")
  addInitParameter(ApplicationConfig.PROPERTY_NATIVE_COMETSUPPORT, "true")
  addInitParameter(ApplicationConfig.DEFAULT_CONTENT_TYPE, "application/json")
  addInitParameter(ApplicationConfig.HEARTBEAT_INTERVAL_IN_SECONDS, "30")
  addInitParameter(ApplicationConfig.CLIENT_HEARTBEAT_INTERVAL_IN_SECONDS, "30")
  addInitParameter(ApplicationConfig.BROADCASTER_MESSAGE_PROCESSING_THREADPOOL_MAXSIZE, "4")
  addInitParameter(ApplicationConfig.BROADCASTER_ASYNC_WRITE_THREADPOOL_MAXSIZE, "4")
  addInitParameter(ApplicationConfig.BROADCASTER_SHARABLE_THREAD_POOLS, "true")
  addInitParameter(ApplicationConfig.BROADCASTER_LIFECYCLE_POLICY, "IDLE_DESTROY")
  addInitParameter(ApplicationConfig.BROADCASTER_LIFECYCLE_POLICY_IDLETIME, "60")
};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy