Attempt to bind this WorkerItem to the worker.
Attempt to bind this WorkerItem to the worker. When the binding succeeds,
onBind()
is called and the item will be able to receive events and
messages. Notice that this method is asynchronous.
The worker to bind to
When bound to a worker, this contains the [WorkerItemBinding]
When bound to a worker, this contains the [WorkerItemBinding]
Called when the item is bound to a worker.
Called when the item is bound to a worker.
Called when the item has been unbound from a worker
Called when the item has been unbound from a worker
Provides a way to send this WorkerItem a message from an Actor by way of WorkerCommand.Message.
Provides a way to send this WorkerItem a message from an Actor by way of WorkerCommand.Message.
The message that was sent
The sender who sent the message
Returns a shared version of the client that can be used across threads, inside futures, etc.
Returns a shared version of the client that can be used across threads, inside futures, etc.
TODO: There is probably room to generalize some of this plumbing
Unbinds the WorkerItem, if it is bound.
Unbinds the WorkerItem, if it is bound. When unbinding is complete,
onUnbind()
is called. This method is asynchronous.
Updates the client list, creating connections for new addresses not in the existing list and closing connections not in the new list
The LoadBalancingClient will evenly distribute requests across a set of clients. If one client begins failing, the balancer will retry up to numRetries times across the other clients (with each failover hitting different clients to avoid a cascading pileup
Note that the balancer will never try the same client twice for a request, so setting maxTries to a very large number will mean that every client will be tried once