nvollmar commented on code in PR #180:
URL:
https://github.com/apache/pekko-persistence-jdbc/pull/180#discussion_r1613480943
##########
core/src/main/scala/org/apache/pekko/persistence/jdbc/journal/dao/BaseJournalDaoWithReadMessages.scala:
##########
@@ -38,13 +38,28 @@ trait BaseJournalDaoWithReadMessages extends
JournalDaoWithReadMessages {
toSequenceNr: Long,
batchSize: Int,
refreshInterval: Option[(FiniteDuration, Scheduler)]):
Source[Try[(PersistentRepr, Long)], NotUsed] = {
+ internalBatchStream(persistenceId, fromSequenceNr, toSequenceNr,
batchSize, refreshInterval).mapConcat(identity)
+ }
+ /**
+ * separate this method for unit tests.
+ */
+ @InternalApi
+ private[dao] def internalBatchStream(persistenceId: String,
+ fromSequenceNr: Long,
+ toSequenceNr: Long,
+ batchSize: Int,
+ refreshInterval: Option[(FiniteDuration, Scheduler)]) = {
Review Comment:
it is generally good practice to do input validation to catch failures early
and make constraints explicit
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]