Everyone knows F# agents are cool right? Well here’s yet another example of how versatile they can be…
There was a series of posts last April by Stephen Toub from the pfxteam at Microsoft. I was reading through some of the posts again the other day and thought some of the ideas presented there would make interesting projects in F# to demonstrate the flexibility and succinctness of the language. I thought the ObjectPool example would make an interesting project in F# using agents aka MailboxProcessors. An ObjectPool is basically a pool of objects that have been pre-created so that you can grab one and use it, and then place it back in the pool when you’re finished. They are useful in situations where the cost of creating object from scratch is very high or you want to cut down on allocations in the garbage collector.
[Read More]