corda / net.corda.client.rpc / CordaRPCClient / use

use

inline fun <A> use(username: String, password: String, block: (CordaRPCConnection) -> A): A

A helper for Kotlin users that simply closes the connection after the block has executed. Be careful not to over-use this, as setting up and closing connections takes time.