These are chat archives for akkadotnet/AkkaStreams

13th
Sep 2018
Arthur A
@arthurandres
Sep 13 2018 07:48
@marcpiechura , it is used for testing. We have sources that emit only once a day. To replicate them in our unit tests we need this type of source. We actually don't have any source in our topology that would complete, ins't streaming all about unbounded data?
Vasily Kirichenko
@vasily-kirichenko
Sep 13 2018 07:50
@arthurandres would Source.queue work for you?
it does not terminate until you call Complete or Abort explicitly.
Arthur A
@arthurandres
Sep 13 2018 07:51
Wouldn't it introduce the complication that I have to get the queue when the source gets materialized?
Vasily Kirichenko
@vasily-kirichenko
Sep 13 2018 07:51
complication?
Arthur A
@arthurandres
Sep 13 2018 07:52
I need to get the queue and put the data in there. Whereas if I can just a one liner like this: builder.add(OnceSource.of(myData))
what would it look like with a Source.queue?
Vasily Kirichenko
@vasily-kirichenko
Sep 13 2018 07:58
yeah, it seems too complicated
Arthur A
@arthurandres
Sep 13 2018 08:01
Thanks anyway. In tests if you want to mock inputs the best solution is to create a TestPublisher.Probe<T> and then create a Source.fromPublisher(). But again there are complication: you need to access the actor system when creating the probe, store your probe in an intermediate variable, feed it the right data after materialization. It's good when you want to inject specific data at specific time, but if you want to emit static data only once it's not worth the complication
Marc Piechura
@marcpiechura
Sep 13 2018 08:30
@arthurandres ok, makes sense for testing but not so much in real world scenarios, hence my question ;-)