debt(pre-router): resolved most of the technical debt that was noted while finishing epic-12 and epic-13.
This commit is contained in:
@@ -3,6 +3,7 @@ package com.correx.core.events.stores
|
||||
import com.correx.core.events.events.NewEvent
|
||||
import com.correx.core.events.events.StoredEvent
|
||||
import com.correx.core.events.types.SessionId
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
|
||||
interface EventStore {
|
||||
@@ -34,4 +35,10 @@ interface EventStore {
|
||||
* Get last sequence number for session.
|
||||
*/
|
||||
fun lastSequence(sessionId: SessionId): Long?
|
||||
|
||||
/**
|
||||
* Subscribe to live events for a session. Emits each event as it is appended.
|
||||
* Does not replay historical events — use [readFrom] for catch-up before subscribing.
|
||||
*/
|
||||
fun subscribe(sessionId: SessionId): Flow<StoredEvent>
|
||||
}
|
||||
Reference in New Issue
Block a user