<commit_before>package services

import akka.stream.Materializer
import akka.stream.scaladsl.Source
import dao.EventDao
import models.{OrderPlaced, UserRecognized}

class NewUserService(eventDao: EventDao[OrderPlaced],
                     users: EventDao[UserRecognized])(
    implicit val mat: Materializer) {

  Source
    .fromPublisher(eventDao.out)
    .mapConcat { placing =>
      placing.order.attendees.map(UserRecognized(_))
    }
    .runForeach(println)

}
<commit_msg>Send events to users event store (no back pressure, events maybe got lost)<commit_after>package services

import akka.stream.Materializer
import akka.stream.scaladsl.Source
import dao.EventDao
import models.{OrderPlaced, UserRecognized}

class NewUserService(eventDao: EventDao[OrderPlaced],
                     users: EventDao[UserRecognized])(
    implicit val mat: Materializer) {

  Source
    .fromPublisher(eventDao.out)
    .mapConcat { placing =>
      placing.order.attendees.map(UserRecognized(_))
    }
    .runForeach(users.store(_))

}

{'fraction_non_alphanumeric': 0.09496124031007752, 'fraction_numerical': 0.0, 'mean_word_length': 3.919047619047619, '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': '2469913', 'n_tokens_mistral': 327, 'n_tokens_neox': 323, 'n_words': 64}