Snippets created by 7sharp9

  • Agent based ObjectPool

    This is a simple implementation of an object pool using an agent (MailboxProcessor). The pool is created with an initial number of object using the specified generator. The ObjectPool has three functions: Put: An item can be 'Put' into the pool. Get: An item can be taken from the pool ToListAndClear: A list of all the items in the pool is returned and the pool is cleared.

    9 people like this

    Posted: 13 years ago by 7sharp9

  • Safely unbox to an option

    An extra primitive that can be used to safely unbox to Some. Useful for use with options where only a single type match is needed and a function is only applied if successful.

    8 people like this

    Posted: 10 years ago by 7sharp9

  • Agent Based Scheduler

    An agent based scheduler, can be sent a single schedule message (ScheduleOnce) and multiple schedule message (Schedule). The schedule messages comprise of a function to receive the message, the message, an initial TimeSpan before the message is scheduled, and another timespan for the schedule repeat. Check out my blog below for more details: http://bit.ly/mK4prb

    9 people like this

    Posted: 13 years ago by 7sharp9