You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "Thejipppp (via GitHub)" <gi...@apache.org> on 2023/02/15 14:38:37 UTC

[GitHub] [incubator-pekko-persistence-dynamodb] Thejipppp commented on pull request #19: test with newer akka

Thejipppp commented on PR #19:
URL: https://github.com/apache/incubator-pekko-persistence-dynamodb/pull/19#issuecomment-1431472806

   Hi (I'm the person @spangaer poked)
   
   As per the documentation, https://doc.akka.io/docs/akka/current/stream/operators/Source-or-Flow/concatLazy.html, 
   
   `To defer the materialization of the given source (or to completely avoid its materialization if the original upstream fails or cancels), wrap it into [Source.lazySource](https://doc.akka.io/docs/akka/current/stream/operators/Source/lazySource.html).`, 
   
   it's good practice to wrap the innersource of the concatLazy in a lazySource.
   
   I tried it out by replacing line 102 of akka.persistence.dynamodb.query.scaladsl.internal.DynamoDBCurrentPersistenceIdsQuery.scala
   `currentResult.concatLazy(lazyStream(nextResult))`
   
   by
   `currentResult.concatLazy(
     Source.lazySource{ () =>
       lazyStream(nextResult)
     }
   )`
   And the test turned green :)
   
   Inspiration taken from https://stackoverflow.com/questions/50269332/akka-streams-concatenating-streams-that-initialise-resources 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org