Skip to content

Commit c8bf90f

Browse files
committed
Refactor restoreOnly method to use InMemoryEventStore for simplified sourcing strategy.
1 parent a0fafdf commit c8bf90f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

krescent-core/src/main/kotlin/dev/helight/krescent/model/ReadModelBase.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dev.helight.krescent.source.EventSourcingStrategy
55
import dev.helight.krescent.source.StoredEventSource
66
import dev.helight.krescent.source.StreamingEventSource
77
import dev.helight.krescent.source.UpgradingStreamingEventSource
8+
import dev.helight.krescent.source.impl.InMemoryEventStore
89
import dev.helight.krescent.source.strategy.CatchupSourcingStrategy
910
import dev.helight.krescent.source.strategy.NoSourcingStrategy
1011
import dev.helight.krescent.source.strategy.StreamingSourcingStrategy
@@ -35,8 +36,8 @@ abstract class ReadModelBase(
3536
suspend fun <M : ReadModelBase> M.stream(source: StreamingEventSource) =
3637
this.strategy(source, StreamingSourcingStrategy())
3738

38-
suspend fun <M : ReadModelBase> M.restoreOnly(source: StoredEventSource) =
39-
this.strategy(UpgradingStreamingEventSource(source), NoSourcingStrategy())
39+
suspend fun <M : ReadModelBase> M.restoreOnly() =
40+
this.strategy(InMemoryEventStore(), NoSourcingStrategy())
4041

4142
}
4243
}

0 commit comments

Comments
 (0)