parent
addc40f4bf
commit
65cc0d8fde
@ -1,7 +1,12 @@
|
|||||||
package allin.data
|
package allin.data
|
||||||
|
|
||||||
abstract class AllInDataSource {
|
abstract class AllInDataSource {
|
||||||
|
|
||||||
abstract val userDataSource: UserDataSource
|
abstract val userDataSource: UserDataSource
|
||||||
|
|
||||||
|
|
||||||
abstract val betDataSource: BetDataSource
|
abstract val betDataSource: BetDataSource
|
||||||
|
|
||||||
|
|
||||||
abstract val participationDataSource: ParticipationDataSource
|
abstract val participationDataSource: ParticipationDataSource
|
||||||
}
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package allin.model
|
||||||
|
|
||||||
|
enum class BetStatus {
|
||||||
|
IN_PROGRESS,
|
||||||
|
WAITING,
|
||||||
|
CLOSING,
|
||||||
|
FINISHED,
|
||||||
|
CANCELLED
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package allin.model
|
||||||
|
|
||||||
|
enum class BetType {
|
||||||
|
MATCH,
|
||||||
|
BINARY,
|
||||||
|
CUSTOM
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package allin.utils
|
||||||
|
|
||||||
|
import kotlinx.coroutines.*
|
||||||
|
import kotlin.time.Duration
|
||||||
|
import kotlin.time.ExperimentalTime
|
||||||
|
|
||||||
|
@OptIn(DelicateCoroutinesApi::class, ExperimentalTime::class)
|
||||||
|
fun kronJob(duration: Duration, action: () -> Unit) =
|
||||||
|
GlobalScope.launch {
|
||||||
|
withContext(Dispatchers.IO) {
|
||||||
|
while (true) {
|
||||||
|
runCatching { action() }
|
||||||
|
delay(duration.toLongMilliseconds())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue