<commit_before>package modules.common.actors

import akka.actor.{Actor, ActorLogging, ActorRef}
import core.graphql.UserContext
import modules.common.actors.DispatcherActor.DispatcherInput

object DispatcherActor {

  final val name = "Dispatcher"

  case class DispatcherInput(input: Any,
                             context: UserContext,
                             resolverActor: ActorRef,
                             sender: ActorRef,
                             filtersBefore: List[ActorRef] = Nil,
                             filtersAfter: List[ActorRef] = Nil)

  case class FilterBeforeInput(input: Any,
                               context: UserContext,
                               dispatcherActor: ActorRef,
                               filtersBefore: List[ActorRef])

  case class FilterAfterInput(input: Any,
                              output: Any,
                              context: UserContext,
                              dispatcherActor: ActorRef,
                              filtersAfter: List[ActorRef])

  case class ResolverInput(input: Any,
                           context: UserContext,
                           dispatcherActor: ActorRef)

}

class DispatcherActor extends Actor with ActorLogging {
  override def receive: Receive = {
    case msg: DispatcherInput => ()
  }
}<commit_msg>Processing 'DispatcherInput' message<commit_after>package modules.common.actors

import akka.actor.{Actor, ActorLogging, ActorRef}
import akka.stream.scaladsl.{Sink, Source}
import akka.stream.{ActorMaterializer, OverflowStrategy}
import core.graphql.UserContext
import javax.inject.Inject
import akka.pattern._
import common.ActorUtil
import modules.common.actors.DispatcherActor.DispatcherInput

import scala.concurrent.{ExecutionContext, Future}

object DispatcherActor {

  final val name = "Dispatcher"

  case class DispatcherInput(input: Any,
                             context: UserContext,
                             resolverActor: ActorRef,
                             sender: ActorRef,
                             filtersBefore: List[ActorRef] = Nil,
                             filtersAfter: List[ActorRef] = Nil)

  case class FilterBeforeInput(input: Any,
                               context: UserContext,
                               dispatcherActor: ActorRef,
                               filtersBefore: List[ActorRef])

  case class FilterAfterInput(input: Any,
                              output: Any,
                              context: UserContext,
                              dispatcherActor: ActorRef,
                              filtersAfter: List[ActorRef])

  case class ResolverInput(input: Any,
                           context: UserContext,
                           dispatcherActor: ActorRef)

}

class DispatcherActor @Inject()(implicit actorMaterializer: ActorMaterializer,
                                executionContext: ExecutionContext) extends Actor
  with ActorLogging
  with ActorUtil {

  override def receive: Receive = {
    case dispatcherInput: DispatcherInput => {
      sendMessageToActor[Any](dispatcherInput.resolverActor, dispatcherInput.input)
        .pipeTo(dispatcherInput.sender)
    }
  }
}
{'fraction_non_alphanumeric': 0.06483790523690773, 'fraction_numerical': 0.0, 'mean_word_length': 1.7403928266438942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6200124', 'n_tokens_mistral': 789, 'n_tokens_neox': 736, 'n_words': 177}