Registry / networking / hyperf-load-balancer

hyperf-load-balancer

JSON →
library3.1.63phppackagistunverified

A load balancer library for Hyperf.

composer require hyperf/load-balancer
INSTALL
IMPORT
SIG · HYPERF-LOAD-BALANC
H
hyperf-load-balancer
networkingphpv3.1.63
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LoadBalancerInterface
use Hyperf\LoadBalancer\LoadBalancerInterface;

Select a node using round-robin load balancing.

use Hyperf\LoadBalancer\LoadBalancerInterface; $nodes = [ ['host' => '192.168.1.1', 'port' => 9501], ['host' => '192.168.1.2', 'port' => 9501], ]; $loadBalancer = new \Hyperf\LoadBalancer\RoundRobin(); $loadBalancer->setNodes($nodes); $node = $loadBalancer->select(); echo $node['host'] . ':' . $node['port'];
Debug
Known issues

No known issues recorded.

Upgrade
Version history
3.1.63latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
hyperf-load-balancer — pip install hyperf-load-balancer · libregistry