Skip to content

Make ConnectionPool Interface Extensible for HTTPAgent #131

@hekike

Description

@hekike

I'd like to be able to extend the ConnectionPool interface with my own custom implementation.
I'd like to implement a ConnectionPool that uses a predictive load-balancer algorithm (moving avg. latency + error rate penalty) instead of the current ~load based logic (available connections).

The new ConnectionPool would be heavily inspired by the following talk:
https://youtu.be/6NdxUY1La2I

Would you be open to making the ConnectionPool for HTTPAgent extensible?
I'm thinking about something like:

const mod_cueball = require('cueball');
const mod_restify = require('restify-clients');
const PredictiveConnectionPool = require('cueball-predictive-connection-pool');

var client = mod_restify.createStringClient({
    url: 'https://us-east.manta.joyent.com',
    agent: new mod_cueball.HttpsAgent({
        connectionPool: new PredictiveConnectionPool({...}),
        recovery: {
            default: {
                timeout: 2000,
                retries: 5,
                delay: 250,
                maxDelay: 1000
            }
        }
    })
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions