2017 © Pedro Peláez
 

project loadbalancer

The load balancing package for laravel

image

puzzz21/loadbalancer

The load balancing package for laravel

  • Wednesday, January 3, 2018
  • by puzzz21
  • Repository
  • 2 Watchers
  • 1 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 40 % Grown

The README.md

Load balancing is used to balance the load through out the available resources. This package implements this concept in PHP. So, lets get started!, (*1)

To install via composer use the following command:, (*2)

composer require puzzz21/loadbalancer
, (*3)

If there is an error regarding minimum stability version then add the following code in your root composer.json file., (*4)

"minimum-stability":"dev"
, (*5)

After the installation, you would be able to see packages folder inside your root directory. Then copy the file packages/nitv/loadBalancer/src/region_servers.sql in your database. You can also create the table with similar name and columns. With the completion of table creation, you need to create a model App\RegionServer for the table region_servers., (*6)

Now you would be able to implement this package in your project. Here is the example: <?php, (*7)

, (*8)

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Nitv\LoadBalancer\GeoBalancerController;
use App\RegionServer;

class TestController extends Controller
{
    public function test()
    {

        $balancer = new GeoBalancerController(new RegionServer());
        $balancer->setDefaultServer('abc.default.com');
        $url = $balancer->getUrl('http://abc.example.com');
        return $url;
    }
}

, (*9)

Notice: here, GeoBalancerController takes instance of RegionServer Model as an argument. Similarly, setDefaultServer takes the default server url and getUrl function takes the stream url., (*10)

The Versions

03/01 2018

dev-master

9999999-dev

The load balancing package for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework