|
|
@ -1,5 +1,6 @@ |
|
|
|
package org.openrs2.archive.cache |
|
|
|
package org.openrs2.archive.cache |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.github.michaelbull.logging.InlineLogger |
|
|
|
import io.netty.bootstrap.Bootstrap |
|
|
|
import io.netty.bootstrap.Bootstrap |
|
|
|
import io.netty.buffer.ByteBuf |
|
|
|
import io.netty.buffer.ByteBuf |
|
|
|
import io.netty.channel.ChannelHandler |
|
|
|
import io.netty.channel.ChannelHandler |
|
|
@ -64,6 +65,8 @@ public class Js5ChannelHandler( |
|
|
|
while (inFlightRequests.size < maxInFlightRequests) { |
|
|
|
while (inFlightRequests.size < maxInFlightRequests) { |
|
|
|
val request = pendingRequests.removeFirstOrNull() ?: break |
|
|
|
val request = pendingRequests.removeFirstOrNull() ?: break |
|
|
|
inFlightRequests += request |
|
|
|
inFlightRequests += request |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.info { "Requesting archive ${request.archive} group ${request.group}" } |
|
|
|
ctx.write(request, ctx.voidPromise()) |
|
|
|
ctx.write(request, ctx.voidPromise()) |
|
|
|
|
|
|
|
|
|
|
|
flush = true |
|
|
|
flush = true |
|
|
@ -199,4 +202,8 @@ public class Js5ChannelHandler( |
|
|
|
groups.forEach(CacheImporter.Group::release) |
|
|
|
groups.forEach(CacheImporter.Group::release) |
|
|
|
groups.clear() |
|
|
|
groups.clear() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private companion object { |
|
|
|
|
|
|
|
private val logger = InlineLogger() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|