LoadBalancer class

A pool of runners, ordered by load.

Keeps a pool of runners, and allows running function through the runner with the lowest current load.

Implemented types

Constructors

LoadBalancer(Iterable<Runner> runners)
Create a load balancer backed by the Runners of runners.

Properties

hashCode int
The hash code for this object.
read-onlyinherited
length int
The number of runners currently in the pool.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

close() Future<void>
Stop the runner.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
run<R>(String path, {dynamic data, Map<String, dynamic> queryParameters, CancelToken cancelToken, Options options, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress}) Future<Response<R>>
Execute the command in the currently least loaded isolate.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create(int size, Future<Runner> createRunner()) Future<LoadBalancer>
Asynchronously create size runners and create a LoadBalancer of those.