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

commonMain.raven.EmailService.kt Maven / Gradle / Ivy

There is a newer version: 3.0.11
Show newest version
package raven

import koncurrent.FailedLater
import koncurrent.Later

class EmailService(
    private val agents: Collection>
) : Service {
    override fun send(params: SendEmailParams): Later {
        val main = agents.firstOrNull() ?: return FailedLater("Main EmailAgent not found in email service")
        val others = agents - main
        for (agent in others) agent.send(params)
        return main.send(params)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy