mirror of
https://github.com/corda/corda.git
synced 2025-06-16 22:28:15 +00:00
CORDA-1844: Support for high throughput Observables shipped via RPC (#3698)
* CORDA-1844: Exposing a problem via Unit test. * CORDA-1844: Unit test update following input from Andras. * CORDA-1844: Add optional parameter to reduce the time it takes to shutdown RPCServer. * CORDA-1844: Add optional parameter to reduce the time it takes to shutdown RPCServer and sensibly default it. Minor changes.
This commit is contained in:
@ -18,11 +18,7 @@ import net.corda.core.serialization.SerializationContext
|
||||
import net.corda.core.serialization.SerializationDefaults
|
||||
import net.corda.core.serialization.SerializationDefaults.RPC_SERVER_CONTEXT
|
||||
import net.corda.core.serialization.deserialize
|
||||
import net.corda.core.utilities.Try
|
||||
import net.corda.core.utilities.contextLogger
|
||||
import net.corda.core.utilities.days
|
||||
import net.corda.core.utilities.debug
|
||||
import net.corda.core.utilities.seconds
|
||||
import net.corda.core.utilities.*
|
||||
import net.corda.node.internal.security.AuthorizingSubject
|
||||
import net.corda.node.internal.security.RPCSecurityManager
|
||||
import net.corda.node.serialization.amqp.RpcServerObservableSerializer
|
||||
@ -247,9 +243,10 @@ class RPCServer(
|
||||
}
|
||||
}
|
||||
|
||||
fun close() {
|
||||
fun close(queueDrainTimeout: Duration = 5.seconds) {
|
||||
// Putting Stop message onto the queue will eventually make senderThread to stop.
|
||||
sendJobQueue.put(RpcSendJob.Stop)
|
||||
senderThread?.join()
|
||||
senderThread?.join(queueDrainTimeout.toMillis())
|
||||
reaperScheduledFuture?.cancel(false)
|
||||
rpcExecutor?.shutdownNow()
|
||||
reaperExecutor?.shutdownNow()
|
||||
|
Reference in New Issue
Block a user