Pooled Channel Allocator

This is my pride and joy! :-)
This Channel Allocator is advanced in that it can keep a certain amount of WCF channels ready (channels that are open) and a certain amount of channels on standby (channels that are created but not open) when you make a service call through EasyProxy. It is thread-safe and has an overflow mechanism that just creates Transient Channels if you exceed the amount of ready and standby channels in the pool. Please note that this is PER SERVICE CONTRACT!
It allows you to change how many channels should be ready and how many should be on standby at a given time.

Why would you need a channel pool? Because certain connections are expensive to make, for instance making connections with services that has the WS* binding, can be costly because of the security overhead. If you have channels that are already open, you save a lot of time when you make a service call.
NOTE: This is NOT recommended for any state or session based calls! Chances are that your state will get mixed up. Use only for stateless calls.

When configuring your channel pool you can pass a PoolChannelAllocatorSettings class instance to the PooledChannelAllocator on construction.

Here are the properties which you can set:
  • ReadyChannelMax - How many channels should be created and open at most?
  • StandbyChannelMax - How many channels should be created (but not open) at most?
  • ReadyChannelRefillThreshold - An amount between 0.0 and 100.0 which indicates the limit under which channels that got closed gets recreated and opened.
  • StandbyChannelRefillThreshold - An amount between 0.0 and 100.0 which indicates the limit under which channels that got closed gets recreated (but not opened).
  • MaxChannelOpenTime - The lifetime of a channel before it gets recycled. We can't keep channels open forever.

Last edited Jun 4, 2013 at 4:10 PM by dandrejvv, version 2

Comments

No comments yet.