mirror of
https://github.com/corda/corda.git
synced 2025-02-20 01:16:42 +00:00
Address PR 207 comments
This commit is contained in:
parent
de63f90745
commit
4afd404db4
@ -112,9 +112,10 @@ interface CordaRPCOps : RPCOps {
|
||||
fun currentNodeTime(): Instant
|
||||
|
||||
/**
|
||||
* Returns whether the node has registered with the network map.
|
||||
* Returns an Observable emitting a single Unit once the node is registered with the network map.
|
||||
*/
|
||||
fun isRegisteredWithNetworkMap(): Boolean
|
||||
@RPCReturnsObservables
|
||||
fun waitUntilRegisteredWithNetworkMap(): Observable<Unit>
|
||||
|
||||
// TODO These need rethinking. Instead of these direct calls we should have a way of replicating a subset of
|
||||
// the node's state locally and query that directly.
|
||||
|
@ -334,7 +334,7 @@ open class DriverDSL(
|
||||
client.start(ArtemisMessagingComponent.NODE_USER, ArtemisMessagingComponent.NODE_USER)
|
||||
return@poll client.proxy()
|
||||
} catch(e: Exception) {
|
||||
log.error("Retrying query node info at $nodeAddress")
|
||||
log.error("Exception $e, Retrying RPC connection at $nodeAddress")
|
||||
null
|
||||
}
|
||||
}
|
||||
@ -380,12 +380,8 @@ open class DriverDSL(
|
||||
registerProcess(processFuture)
|
||||
return processFuture.flatMap { process ->
|
||||
establishRpc(messagingAddress, configuration).flatMap { rpc ->
|
||||
poll(executorService, "$name to register with the network map") {
|
||||
if (rpc.isRegisteredWithNetworkMap()) {
|
||||
NodeHandle(rpc.nodeIdentity(), rpc, configuration, process)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
rpc.waitUntilRegisteredWithNetworkMap().toFuture().map {
|
||||
NodeHandle(rpc.nodeIdentity(), rpc, configuration, process)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,8 +111,7 @@ class CordaRPCOpsImpl(
|
||||
}
|
||||
}
|
||||
|
||||
override fun isRegisteredWithNetworkMap() = services.networkMapCache.mapServiceRegistered.isDone
|
||||
|
||||
override fun waitUntilRegisteredWithNetworkMap() = services.networkMapCache.mapServiceRegistered.toObservable()
|
||||
override fun partyFromKey(key: CompositeKey) = services.identityService.partyFromKey(key)
|
||||
override fun partyFromName(name: String) = services.identityService.partyFromName(name)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user