Git Product home page Git Product logo

Comments (4)

xiemalin avatar xiemalin commented on June 10, 2024

感谢反馈。
1。 这个设计目标并不单指连接不可用时,而且是在连接繁忙,占用的情况采用异步的方式发送,以提前吞吐能力的。
2。 这个设计只针对长链接的方式才有效。
3。 validateObject是使用者可设置开启或关闭的, 这一块应用的common-pool的实现

from jprotobuf-rpc-socket.

iSenninha avatar iSenninha commented on June 10, 2024

感谢反馈。
1。 这个设计目标并不单指连接不可用时,而且是在连接繁忙,占用的情况采用异步的方式发送,以提前吞吐能力的。
2。 这个设计只针对长链接的方式才有效。
3。 validateObject是使用者可设置开启或关闭的, 这一块应用的common-pool的实现

感谢解答!还有点疑问:
1.连接繁忙,占用 是指建立连接的过程繁忙吗?如果是的话

        // Wait until the connection is made successfully.
        future.awaitUninterruptibly();

上面这个是会同步等待到整个连接建立完成/失败吧?

from jprotobuf-rpc-socket.

xiemalin avatar xiemalin commented on June 10, 2024

不是建立链接过程繁忙,因为我们使用的是连接池的方案,已经建立完成的链接,有可能出现短时不可用的情况,这个影响因素很多

from jprotobuf-rpc-socket.

iSenninha avatar iSenninha commented on June 10, 2024

嗯嗯,其实我疑问的根源是,这个队列的消费是注册在future的回调的,这个future是建立连接这个操作的future吧?建立链接完成后出现短时不可用,我们把请求丢在缓存队列中,这个链接恢复后,这个future还会去回调去消费吗?

    @Override
    public PooledObject<Connection> wrap(Connection connection) {
        InetSocketAddress address;
        if (host == null) {
            address = new InetSocketAddress(port);
        } else {
            address = new InetSocketAddress(host, port);
        }
        ChannelFuture future = this.rpcClient.connect(address);

        // Wait until the connection is made successfully.
        future.awaitUninterruptibly();
        if (!future.isSuccess()) {
            LOGGER.log(Level.SEVERE, "failed to get result from stp", future.cause());
        } else {
            connection.setIsConnected(true);
        }

       // 建立网络链接完成后,短时不可用恢复后,这个future还会有回调吗?
        future.addListener(new RpcChannelFutureListener(connection));
        connection.setFuture(future);
        
        return new DefaultPooledObject<Connection>(connection);
    }

from jprotobuf-rpc-socket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.