Last active
June 28, 2017 07:56
-
-
Save kastoestoramadus/fe3eed760997da32cdcf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generate cyclic sending mail wiht rotation on chosen data | |
private def generateMailsSending(sentmails: Meter): Cancellable = { | |
import sys.process._ | |
val getNextHeaderSet: () => ClientHeaders = { | |
def b(): Stream[ClientHeaders] = headers.toStream #::: b | |
var cyclicIterator: Stream[ClientHeaders] = b() | |
() => { | |
val tail = cyclicIterator.tail | |
val result = tail.head | |
cyclicIterator = tail | |
result | |
} | |
} | |
// requires sendmail and unix os host | |
context.system.scheduler.schedule(Config.MAILS_DURATION, Config.MAILS_DURATION) { | |
"echo anything" #| s"sendmail ${getNextHeaderSet().msisdn}@[$BASE_IP]" !; | |
sentmails.mark() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment