commonMain.raven.SmsService.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of raven-sms-core-jvm Show documentation
Show all versions of raven-sms-core-jvm Show documentation
An abstraction form sending emails
package raven
import koncurrent.FailedLater
import koncurrent.Later
class SmsService(
private val agents: Collection>
) : Service {
override fun send(params: SendSmsParams): Later {
val main = agents.firstOrNull() ?: return FailedLater("Main SmsAgent not found in sms service")
val others = agents - main
for (agent in others) agent.send(params)
return main.send(params)
}
}