Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
forgot these
Browse files Browse the repository at this point in the history
  • Loading branch information
homchom committed Jun 26, 2024
1 parent aed9e6f commit 920f6bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ enum class DonorRank(override val displayName: String) : Rank {
NOBLE("Noble"),
EMPEROR("Emperor"),
MYTHIC("Mythic"),
OVERLORD("${DIAMOND}Overlord$DIAMOND")
OVERLORD("${DIAMOND}Overlord${DIAMOND}")
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import io.github.homchom.recode.util.math.Frequency
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.updateAndGet

/**
Expand All @@ -24,12 +25,12 @@ class RateLimiter @OptIn(DelicateCoroutinesApi::class) constructor(
val limit: Int = Int.MAX_VALUE,
private val coroutineScope: CoroutineScope = GlobalScope
) {
private val _count = MutableStateFlow(0)

/**
* A [StateFlow] of the current counter, as determined by [record].
*/
val count: StateFlow<Int> get() = _count

private val _count = MutableStateFlow(0)
val count = _count.asStateFlow()

/**
* Records the occurrence of an event that should be rate-limited.
Expand Down

0 comments on commit 920f6bc

Please sign in to comment.