All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.turbomates.event.EventStore.kt Maven / Gradle / Ivy

package com.turbomates.event

import java.util.LinkedList

class EventStore {
    private val events: LinkedList = LinkedList()
    fun addEvent(event: Event) {
        events.push(event)
    }

    fun raiseEvents(): Sequence = sequence {
        while (events.isNotEmpty()) {
            yield(events.pop())
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy