<commit_before>package akka.scalajs.wsserver

import akka.actor._
import akka.scalajs.wscommon.AbstractProxy

import play.api._
import play.api.mvc._
import play.api.libs.json._
import play.api.libs.iteratee._
import play.api.libs.concurrent.Akka

import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits._

object ActorWebSocket {
  def apply(f: RequestHeader => Future[Any]) = {
    WebSocket.async[JsValue] { request =>
      f(request).map(_.asInstanceOf[(Iteratee[JsValue, Unit], Enumerator[JsValue])])
    }
  }

  def actorForWebSocketHandler(entryPointRef: ActorRef)(
      implicit context: ActorRefFactory): (Iteratee[JsValue, Unit], Enumerator[JsValue]) = {<commit_msg>to Version 0.6<commit_after>package akka.scalajs.wsserver

import akka.actor._
import akka.scalajs.wscommon.AbstractProxy

import play.api._
import play.api.mvc._
import play.api.libs.json._
import play.api.libs.iteratee._
import play.api.libs.concurrent.Akka

//import scala.concurrent.Future
//import scala.concurrent.ExecutionContext.Implicits._

import play.api.mvc._
import play.api.Play.current

object ActorWebSocket {
  def apply(f: RequestHeader => Future[Any]) = {
    WebSocket.async[JsValue] { request =>
      f(request).map(_.asInstanceOf[(Iteratee[JsValue, Unit], Enumerator[JsValue])])
    }
  }
  
  def socket = WebSocket.using[JsValue] { request =>

    val (out, channel) = Concurrent.broadcast[String]

    val in = Iteratee.foreach[JsValue] {
    	msg => 
    	  	serverProxy ! AbstractProxy.IncomingMessage(msg)
    		channel push("I received your message: " + msg)
    }
    (in,out)
  }
  
  
  def actorForWebSocketHandler(entryPointRef: ActorRef)(
      implicit context: ActorRefFactory): (Iteratee[JsValue, Unit], Enumerator[JsValue]) = {
{'fraction_non_alphanumeric': 0.12133182844243792, 'fraction_numerical': 0.001128668171557562, 'mean_word_length': 4.340361445783133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1376456', 'n_tokens_mistral': 606, 'n_tokens_neox': 590, 'n_words': 107}