PING cancelRequest now uses send(), so that events are processed in order (instead of concurrently)

This commit is contained in:
Robinson 2023-03-17 14:58:04 +01:00
parent eb0e59b7ba
commit 460840fad3
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C

View File

@ -183,8 +183,8 @@ internal class ResponseManager(maxValuesInCache: Int = 65535, minimumValue: Int
/** /**
* Cancels the RMI request in the given timeout, the callback is executed inside the read lock * Cancels the RMI request in the given timeout, the callback is executed inside the read lock
*/ */
fun cancelRequest(eventDispatch: EventDispatcher, timeoutMillis: Long, id: Int, logger: KLogger, onCancelled: ResponseWaiter.() -> Unit) { suspend fun cancelRequest(eventDispatch: EventDispatcher, timeoutMillis: Long, id: Int, logger: KLogger, onCancelled: ResponseWaiter.() -> Unit) {
eventDispatch.launch { eventDispatch.send {
delay(timeoutMillis) // this will always wait. if this job is cancelled, this will immediately stop waiting delay(timeoutMillis) // this will always wait. if this job is cancelled, this will immediately stop waiting
// check if we have a result or not // check if we have a result or not