Snippets created by Aaron Eshbach
-
A generic, thread-safe version of a MemoryCache based on ConcurrentDictionary, and a memoize function implemented using the MemoryCache.
1 people like this
Like the snippet!
Posted: 6 years ago by
Aaron Eshbach
-
An F#-style API for simple MSMQ operations, including Peek, Receive, and Send.
3 people like this
Like the snippet!
Posted: 6 years ago by
Aaron Eshbach
-
When writing asynchronous code in F#, one often needs to call methods in the .NET BCL that return Task or Task rather than the F# native Async<'a> type. While the Async.AwaitTask function can convert a Task into an Async<'a>, there is some cognitive overhead in having to keep track of which functions return Task and which functions are Async. To simplify this interoperability, this code provides new `await` computation expression that supports using both Async<'a> and Task or Task inside it. This works by unifying the Task and Async types in the Awaitable DU, and overloading the Bind, ReturnFrom, Combine, and Using methods on the AwaitableBuilder Computation Builder to handle Awaitable<'a>, Async<'a>, Task, and Task.
5 people like this
Like the snippet!
Posted: 6 years ago by
Aaron Eshbach
-
F# Functional-style API for MSMQ, providing simple client operations like Send, Receive, and Peek.
3 people like this
Like the snippet!
Posted: 6 years ago by
Aaron Eshbach