blob: 152be7b71c0e6f7b34303fab62cf11701af37eb5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
package cat.freya.khs
import java.util.UUID
import java.util.concurrent.ConcurrentHashMap
data class Request(val fn: () -> Unit, val lengthSeconds: Long) {
val start = System.currentTimeMillis()
val expired: Boolean
get() = (System.currentTimeMillis() - start) < lengthSeconds * 1000
}
val REQUESTS: MutableMap<UUID, Request> = ConcurrentHashMap<UUID, Request>()
|