Suppose I use an *Adaptive Load Balancing Router* in an actor subscriber as 
partially demonstrated in the akka stream documentation, is this in effect 
providing back pressure for all my routee actors to ensure that they aren't 
overwhelm with messages?  And that the worker pool actor subscriber will 
apply back pressure when all the routees are near capacity? 

The workflow I have in mind is to forward all HTTP requests to this actor 
and distributed them to routees.  But I would like to drop any requests 
when my routees cannot handle anymore requests without crashing by setting 
the source's overflow strategy to drop new. 

class WorkerPool extends ActorSubscriber {
 import WorkerPool._
 import ActorSubscriberMessage._
 
 val MaxQueueSize = 10
 var queue = Map.empty[Int, ActorRef]
 
 val router = { // What if this was an Adaptive Load Balance Router instead?
   val routees = Vector.fill(3) {
     ActorRefRoutee(context.actorOf(Props[Worker]))
   }
     Router(RoundRobinRoutingLogic(), routees)
 }
 
 override val requestStrategy = new MaxInFlightRequestStrategy(max = 
MaxQueueSize) {
 override def inFlightInternally: Int = queue.size
 }
}


-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to