Skip to content

Commit

Permalink
removed duplicate endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ticofab committed Jul 9, 2015
1 parent 725084a commit f9f6692
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
16 changes: 0 additions & 16 deletions app/controllers/Application.scala
Expand Up @@ -37,22 +37,6 @@ class Application @Inject()(ws: WSClient) extends Controller {
}
}

// async version of the echo websocket -- code is exactly the same!
def wsEchoAsync = WebSocket.using[String] {
request =>
Logger.info(s"wsEchoAsync, client connected.")
var channel: Option[Concurrent.Channel[String]] = None
val outEnumerator: Enumerator[String] = Concurrent.unicast(c => channel = Some(c))

val inIteratee: Iteratee[String, Unit] = Iteratee.foreach[String](receivedString => {
// send string back
Logger.info(s"wsEchoAsync, received: $receivedString")
channel.foreach(_.push(receivedString))
})

(inIteratee, outEnumerator)
}

// sends the time every second, ignores any input
def wsTime = WebSocket.using[String] {
request =>
Expand Down
1 change: 0 additions & 1 deletion conf/routes
Expand Up @@ -8,7 +8,6 @@ GET /httpWeather controllers.Application.httpWeatherProxy

# Websocket endpoints
GET /echo controllers.Application.wsEcho
GET /echoAsync controllers.Application.wsEchoAsync
GET /time controllers.Application.wsTime
GET /pingpong controllers.Application.wsPingPong
GET /interleave controllers.Application.wsInterleave
Expand Down

0 comments on commit f9f6692

Please sign in to comment.