Added close for rmi support, removed actor
This commit is contained in:
parent
cd42f6b85d
commit
f84bcdbec5
|
@ -38,7 +38,6 @@ import kotlinx.atomicfu.atomic
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.cancel
|
import kotlinx.coroutines.cancel
|
||||||
import kotlinx.coroutines.channels.actor
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import mu.KLogger
|
import mu.KLogger
|
||||||
|
@ -69,18 +68,6 @@ internal constructor(val type: Class<*>, internal val config: Configuration) : A
|
||||||
protected constructor(config: ServerConfiguration) : this(Server::class.java, config)
|
protected constructor(config: ServerConfiguration) : this(Server::class.java, config)
|
||||||
|
|
||||||
|
|
||||||
fun CoroutineScope.connectionActor() = actor<ActorMessage<CONNECTION>> {
|
|
||||||
var counter = 0
|
|
||||||
|
|
||||||
for (message in channel) {
|
|
||||||
when(message) {
|
|
||||||
is ActorMessage.AddConnection -> println("add")
|
|
||||||
is ActorMessage.RemoveConnection -> println("del")
|
|
||||||
// is ActorMessage.GetValue -> message.deferred.complete(counter)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
/**
|
/**
|
||||||
* Identifier for invalid sessions. This must be < RESERVED_SESSION_ID_LOW
|
* Identifier for invalid sessions. This must be < RESERVED_SESSION_ID_LOW
|
||||||
|
@ -609,6 +596,8 @@ internal constructor(val type: Class<*>, internal val config: Configuration) : A
|
||||||
autoClosableObjects.clear()
|
autoClosableObjects.clear()
|
||||||
|
|
||||||
runBlocking {
|
runBlocking {
|
||||||
|
rmiGlobalSupport.close()
|
||||||
|
|
||||||
// don't need anything fast or fancy here, because this method will only be called once
|
// don't need anything fast or fancy here, because this method will only be called once
|
||||||
connections.forEach {
|
connections.forEach {
|
||||||
it.close()
|
it.close()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user