Hacker News new | past | comments | ask | show | jobs | submit login

That assumption is incorrect. Implicits are not used here (for that purpose anyways).

The client connection is handled by that "WebSocket.using[String]" handler. This is just a function that takes a function which takes a Request and returns an Iteratee and an Enumerator. In Play, this is known as an Action. Actions take Requests and return Results.

You can see that in the type signature of the WebSocket class: http://www.playframework.com/documentation/2.2.x/api/scala/i...

  (f: (RequestHeader) ⇒ (Enumerator[A], Iteratee[A, Unit]) ⇒ Unit)
So the client connection is not bound using implicits, it's bound when that function is actually executed. This function (f) is invoked by the router when a request comes in for that controller action. This is done using HandlerInvoker: http://www.playframework.com/documentation/2.2.x/api/scala/i...

Now, my explanation is not the most eloquent nor is it really necessary to understand all of this, though it certainly helps.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: