This commit is contained in:
2024-05-30 21:41:02 +02:00
parent 03ba14d918
commit ae5c229e4b
32 changed files with 537 additions and 344 deletions

View File

@@ -0,0 +1,19 @@
package eventDemo.libs.event
import kotlinx.coroutines.flow.Flow
import kotlin.reflect.KClass
interface EventStream<E : Event<ID>, ID : AggregateId> {
fun publish(event: E)
fun publish(vararg events: E)
fun readLast(aggregateId: ID): E?
fun <R : E> readLastOf(
aggregateId: ID,
eventType: KClass<out R>,
): E?
fun readAll(aggregateId: ID): Flow<E>
}