-
1. Re: Logic of deliver() duplicated in directDeliver()
ataylor Nov 12, 2009 2:00 PM (in response to timfox)I can't see any, I would change it
-
2. Re: Logic of deliver() duplicated in directDeliver()
timfox Nov 12, 2009 2:05 PM (in response to timfox)I think I'm going to do a refactoring tomorrow.
Also, there's another issue here.
The current delivery algorithm assumes that the distributor will eventually return all consumers - and it won't exit the loop until this occurs.
This will work for the RoundRobinDistributor which is guaranteed to return all consumers after N calls, where N is the number of consumers in total.
However for other conceivable distributors, e.g. one that always returns the first member, this won't work and the algo will spin in an infinite loop.
I am now thinking is there any value in allowing different distributions other than round robin?
If not, then we can remove the Distributor altogether and let the QueueImpl manage a list of consumers directly. This will simplify the delivery logic significantly and allow us to remove the busy and null consumer sets.
wdyt? -
3. Re: Logic of deliver() duplicated in directDeliver()
ataylor Nov 12, 2009 2:12 PM (in response to timfox)That's a good point. I cant think of any other kind of distributor, i would remove it and simplify the code.
-
4. Re: Logic of deliver() duplicated in directDeliver()
mural74 Nov 12, 2009 6:07 PM (in response to timfox)I guess that a distributor that takes into consideration the latency of the consumer would be a possible kind of distributor. Not sure how hard it would be to implement, though.