Skip to content

Equip SMF-Client with back pressure mechanism #10

@KowalczykBartek

Description

@KowalczykBartek

Equip SMF-Client with back pressure mechanism, basically, this method have to check if channel is writable,

    public void executeAsync(long methodMeta, byte[] body, final Consumer<ByteBuffer> callback) {
        int sessionId = sessionIdGenerator.next();
        LOG.info("Constructing RPC call for sessionId {}", sessionId);
        final RpcRequest rpcRequest = new RpcRequest(sessionId, methodMeta, body, callback);
        dispatcher.assignCallback(sessionId, rpcRequest.getCallback());
        //channel.isWritable() has to be checked before.
        channel.writeAndFlush(rpcRequest);
    }

otherwise, we can just kill GC, because it will not be able to keep up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions