mirror of
https://github.com/logos-messaging/nim-chat-sdk.git
synced 2026-01-03 22:53:12 +00:00
Apply suggestions from code review
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
This commit is contained in:
parent
8c6d5ab16f
commit
5ee4734590
@ -86,7 +86,7 @@ proc passToSender[T: Serializable](
|
||||
|
||||
proc processCriticalQueue[T: Serializable](
|
||||
manager: RateLimitManager[T], now: Moment
|
||||
): Future[void] {.async.} =
|
||||
) {.async.} =
|
||||
while manager.queueCritical.len > 0:
|
||||
let msgs = manager.queueCritical.popFirst()
|
||||
let capacityState = manager.getCapacityState(now, msgs.len)
|
||||
@ -101,7 +101,7 @@ proc processCriticalQueue[T: Serializable](
|
||||
|
||||
proc processNormalQueue[T: Serializable](
|
||||
manager: RateLimitManager[T], now: Moment
|
||||
): Future[void] {.async.} =
|
||||
) {.async.} =
|
||||
while manager.queueNormal.len > 0:
|
||||
let msgs = manager.queueNormal.popFirst()
|
||||
let capacityState = manager.getCapacityState(now, msgs.len)
|
||||
@ -161,7 +161,7 @@ proc getEnqueued*[T: Serializable](
|
||||
|
||||
return (criticalMsgs, normalMsgs)
|
||||
|
||||
proc startQueueHandleLoop*[T: Serializable](
|
||||
proc queueHandleLoop[T: Serializable](
|
||||
manager: RateLimitManager[T],
|
||||
nowProvider: proc(): Moment {.gcsafe.} = proc(): Moment {.gcsafe.} =
|
||||
Moment.now(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user