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.

    7 people like this

    Posted: 5 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.

    5 people like this

    Posted: 2 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:

    6 people like this

    Posted: 5 years ago by 7sharp9