Take the 2-minute tour ×  Have you tried to use a
MailboxProcessor of T from C#? Could you post sample code?  How
do you start a new one, post messages to it, and how do you
process them?  share|improve this question add comment  2
Answers  up vote 11 down vote accepted  While you can use
MailboxProcessor<T> directly from C# (using the C# async
extension) as pointed out in my other answer, this isn't really
a good thing to do - I wrote that mainly for curiosity.  The
MailboxProcessor<T> type was designed to be used from F#, so it
doesn't fit well with the C# programming model. You could
probably implement similar API for C#, but it wouldn't be that
nice (certainly not in C# 4.0). The TPL DataFlow library (CTP)
provides similar design for the futrue version of C#.
Currently, the best thing to do is to implement the agent using
MailboxProcessor<T> in F# and make it friendly to C# usage by
using Task. This way, you can implement the core parts of agents
in F# (using tail-recursion and async workflows) and then