remove sync modifier from getConnectionState and tidy
This commit is contained in:
parent
f2b2fc769f
commit
94ca2a04e6
1 changed files with 6 additions and 5 deletions
|
@ -31,9 +31,10 @@ public abstract class RpcSystem<VatId> {
|
||||||
getConnectionState(connection);
|
getConnectionState(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized RpcState getConnectionState(VatNetwork.Connection connection) {
|
RpcState getConnectionState(VatNetwork.Connection connection) {
|
||||||
|
|
||||||
var onDisconnect = new CompletableFuture<VatNetwork.Connection>().thenAccept(lostConnection -> {
|
var onDisconnect = new CompletableFuture<VatNetwork.Connection>()
|
||||||
|
.thenAccept(lostConnection -> {
|
||||||
this.connections.remove(lostConnection);
|
this.connections.remove(lostConnection);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -50,7 +51,7 @@ public abstract class RpcSystem<VatId> {
|
||||||
|
|
||||||
private CompletableFuture<java.lang.Void> doMessageLoop() {
|
private CompletableFuture<java.lang.Void> doMessageLoop() {
|
||||||
var accept = this.getAcceptLoop();
|
var accept = this.getAcceptLoop();
|
||||||
for (var conn : connections.values()) {
|
for (var conn: this.connections.values()) {
|
||||||
accept = accept.acceptEither(conn.getMessageLoop(), x -> {});
|
accept = accept.acceptEither(conn.getMessageLoop(), x -> {});
|
||||||
}
|
}
|
||||||
return accept.thenCompose(x -> this.doMessageLoop());
|
return accept.thenCompose(x -> this.doMessageLoop());
|
||||||
|
|
Loading…
Reference in a new issue