|
@@ -1,8 +1,8 @@
|
1
|
1
|
package fr.natan.akkastreamfileprocessingapi.service
|
2
|
2
|
|
3
|
|
-import akka.Done
|
4
|
3
|
import akka.actor.ActorSystem
|
5
|
|
-import akka.stream.scaladsl.{Sink, Source}
|
|
4
|
+import akka.stream.scaladsl.{Flow, Sink, Source}
|
|
5
|
+import akka.{Done, NotUsed}
|
6
|
6
|
import com.typesafe.scalalogging.slf4j.Logger
|
7
|
7
|
import fr.natan.akkastreamfileprocessingapi.datasource.Datasource.{nameBasics, titleBasics, titlePrincipalsBasics}
|
8
|
8
|
import fr.natan.akkastreamfileprocessingapi.models.Models.{Person, TvSerie}
|
|
@@ -65,7 +65,7 @@ class AkkaStreamFileProcessingImpl extends AkkaStreamFileProcessing {
|
65
|
65
|
})
|
66
|
66
|
res
|
67
|
67
|
}
|
68
|
|
- override def getTvSerieByPrimaryTitle(tvSeriePrimaryTitle: String): List[TvSerie] = {
|
|
68
|
+ override def getTvSerieByPrimaryTitle(tvSeriePrimaryTitle: String): Future[List[TvSerie]] = {
|
69
|
69
|
|
70
|
70
|
val tvSeriesSource: Source[Map[String, String], _] = buildAndValidateSource(inputFile = titleBasics)
|
71
|
71
|
|
|
@@ -79,9 +79,8 @@ class AkkaStreamFileProcessingImpl extends AkkaStreamFileProcessing {
|
79
|
79
|
value.foreach((tvSrie: TvSerie) => logger.info(s"$tvSrie"))
|
80
|
80
|
logger.info("SUCCESS")
|
81
|
81
|
})
|
82
|
|
- Await.result(tvSries,2 minutes)
|
83
|
|
- val tvSriesList : List[TvSerie] = tvSries.value.get.get
|
84
|
|
- tvSriesList
|
|
82
|
+
|
|
83
|
+ tvSries
|
85
|
84
|
}
|
86
|
85
|
|
87
|
86
|
|