Skip to content

Commit

Permalink
drop expect/actual for currentMillis
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Nov 13, 2023
1 parent 2f4e1d0 commit 67573af
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ import io.rsocket.kotlin.frame.*
import io.rsocket.kotlin.keepalive.*
import kotlinx.atomicfu.*
import kotlinx.coroutines.*
import kotlin.time.*

internal class KeepAliveHandler(
private val keepAlive: KeepAlive,
private val sender: FrameSender
private val sender: FrameSender,
) {
private val initial = TimeSource.Monotonic.markNow()
private fun currentMillis() = initial.elapsedNow().inWholeMilliseconds

private val lastMark = atomic(currentMillis()) // mark initial timestamp for keepalive

suspend fun mark(frame: KeepAliveFrame) {
Expand All @@ -42,5 +46,3 @@ internal class KeepAliveHandler(
sender.sendKeepAlive(true, 0, ByteReadPacket.Empty)
}
}

internal expect fun currentMillis(): Long

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 67573af

Please sign in to comment.