<commit_before>package com.tpg.pnode

import akka.actor.Actor
import akka.stream.actor.{ActorPublisherMessage, ActorPublisher}

import scala.reflect.ClassTag


class RabbitQueueSource extends Actor with ActorPublisher[Any] {
  import ActorPublisherMessage._

  var rabbitMsgQueue:List[Any] = List.empty

  def receive = {
    
    case Request(demand) =>
      if (demand > rabbitMsgQueue.size){
        rabbitMsgQueue foreach (onNext)
        rabbitMsgQueue = List.empty
      }
      else {
        val (send, keep) = rabbitMsgQueue.splitAt(demand.toInt)
        rabbitMsgQueue = keep
        send foreach (onNext)
      }


    case rabbitMessage =>
      if (totalDemand == 0)
        rabbitMsgQueue = rabbitMsgQueue :+ rabbitMessage
      else
        onNext(rabbitMessage)
  }


}
<commit_msg>nail down type of messages processed by rabbit actor<commit_after>package com.tpg.pnode

import akka.actor.Actor
import akka.stream.actor.{ActorPublisherMessage, ActorPublisher}

import scala.reflect.ClassTag


class RabbitQueueSource extends Actor with ActorPublisher[String] {
  import ActorPublisherMessage._

  var rabbitMsgQueue:List[String] = List.empty

  def receive = {
    
    case Request(demand) =>
      if (demand > rabbitMsgQueue.size){
        rabbitMsgQueue foreach (onNext)
        rabbitMsgQueue = List.empty
      }
      else {
        val (send, keep) = rabbitMsgQueue.splitAt(demand.toInt)
        rabbitMsgQueue = keep
        send foreach (onNext)
      }


    case rabbitMessage:String =>
      if (totalDemand == 0)
        rabbitMsgQueue = rabbitMsgQueue :+ rabbitMessage
      else
        onNext(rabbitMessage)
  }


}

{'fraction_non_alphanumeric': 0.08060606060606061, 'fraction_numerical': 0.0012121212121212121, 'mean_word_length': 2.8847058823529412, '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': '6715275', 'n_tokens_mistral': 538, 'n_tokens_neox': 468, 'n_words': 112}