org.rx.net.rpc.impl.NonClientPool Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rxlib Show documentation
Show all versions of rxlib Show documentation
A set of utilities for Java
package org.rx.net.rpc.impl;
import lombok.RequiredArgsConstructor;
import org.rx.core.App;
import org.rx.net.rpc.RpcClientConfig;
import org.rx.net.rpc.RpcClientPool;
@RequiredArgsConstructor
public class NonClientPool implements RpcClientPool {
private final RpcClientConfig template;
@Override
public StatefulRpcClient borrowClient() {
RpcClientConfig config = App.deepClone(template);
StatefulRpcClient client = new StatefulRpcClient(config);
client.connect(true);
return client;
}
@Override
public StatefulRpcClient returnClient(StatefulRpcClient client) {
return client;
}
}