[This is preliminary documentation and is subject to change.]
| C# | Visual Basic | Visual C++ |
public class LoadBalancer
Public Class LoadBalancer
public ref class LoadBalancer
| All Members | Constructors | Methods | Properties | Fields | |
| Icon | Member | Description |
|---|---|---|
| LoadBalancerLoadBalancerNew(Object, Int32, Int64) | Constructs a LoadBalancer to represent a specific logical task.
| |
| AddLoadBalancerListener(ILoadBalancerListener) | Register a LoadBalancerListener with this LoadBalancer. The listener will
be called when the free pool is empty and subsequently contains at least
two Batons (or one Baton if this LoadBalancer was defined to have a pool
size of one).
| |
| CheckinBaton(Baton) | Check-in a Baton. | |
| CheckoutBaton()() | Check-out a Baton. | |
| Define(LoadBalancer) | Define a LoadBalancer that may be subsequently returned by the lookup method. | |
| FreeBatons | Gets the number of Batons | |
| Load | Gets the current load (the number of Batons in use) | |
| lookup(Object) | Lookup a LoadBalancer that was previously defined by the define method. | |
| removeLoadBalancerListener(ILoadBalancerListener) | Remove a LoadBalancerListener previously registered with the
addLoadBalancerListener method
| |
| TotalBatons | Gets the total number of Batons | |
| TRACE |
For example, you could create a LoadBalancer that represents the task "query all students" and assign it an initial pool of 5 Batons, meaning at most 5 threads will be able to carry out this task at once. A thread must check out a Baton in order to perform the task, and must release it back to the LoadBalancer when finished.
Refer to the Baton class for a description of how to use the LoadBalancer and Baton classes and the LoadBalancerListener interface. These classes can be used to introduce internal load balancing into an agent to significantly improve scalability when connecting to tens or hundreds of zones concurrently.
| Object | |
| LoadBalancer | |