Nightmarish Pawnshop Mystic

    nsky-load-balancer

    0.0.5 • Public • Published

    nsky-loadBalancer


    Consul base load balancer

    install

    npm install nsky-load-balancer --save-dev
    

    Usage

    const loadBalancer = require('nsky-load-balancer')
     
    app.use(function* (next) {
      yield loadBalancer.getBalancedHosts(this, ["nsky-taxi", "nsky-daijia", "nsky-tag"]);
     
      this.body = loadBalancer.balancedHosts
    })
     
    let tagUrl = loadBalancer.balancedHosts["nsky-tag"]
     

    API

    @param 
    context
    serviceNameArray
    time 刷新时间
     
    loadBalancer.getBalancedHosts(context, serviceNameArray, time)
     
    loadBalancer.stopLoadBalanced()
    serviceNameArray:
        nsky-taxi
        nsky-hitch
        nsky-pcs
        nsky-daijia
        nsky-bus
        nsky-tag
        nsky-geofence
        nsky-ntfy
        nsky-weather
        nsky-dgrid
        nsky-graph
        nsky-query

    Development

    npm install
    npm run dev
    

    Install

    npm i nsky-load-balancer

    DownloadsWeekly Downloads

    7

    Version

    0.0.5

    License

    MIT

    Last publish

    Collaborators

    • freestyle21