Prevent RootServer.create cancelling the entire scope
This commit is contained in:
@@ -270,7 +270,7 @@ class RootServer {
|
||||
@Throws(RemoteException::class)
|
||||
fun <T : Parcelable?> create(command: RootCommandChannel<T>, scope: CoroutineScope,
|
||||
classLoader: ClassLoader?) = scope.produce<T>(
|
||||
capacity = command.capacity.also {
|
||||
SupervisorJob(), command.capacity.also {
|
||||
when (it) {
|
||||
Channel.UNLIMITED, Channel.CONFLATED -> { }
|
||||
else -> throw IllegalArgumentException("Unsupported channel capacity $it")
|
||||
|
||||
@@ -21,7 +21,6 @@ import timber.log.Timber
|
||||
import java.io.IOException
|
||||
import java.io.InterruptedIOException
|
||||
import kotlin.concurrent.thread
|
||||
import kotlin.coroutines.EmptyCoroutineContext
|
||||
|
||||
abstract class IpMonitor {
|
||||
companion object {
|
||||
@@ -109,7 +108,7 @@ abstract class IpMonitor {
|
||||
if (destroyed) return@thread
|
||||
}
|
||||
try {
|
||||
runBlocking(EmptyCoroutineContext + worker) {
|
||||
runBlocking(worker) {
|
||||
RootManager.use { server ->
|
||||
// while we only need to use this server once, we need to also keep the server alive
|
||||
handleChannel(server.create(ProcessListener(errorMatcher, Routing.IP, "monitor", monitoredObject),
|
||||
|
||||
Reference in New Issue
Block a user