All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.rx.net.rpc.impl.NonClientPool Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy