Async F # vs. CCR framework

After reading CCR: http://www.infoq.com/news/2008/12/CCR I was under the impression that it is pretty much like F # async blocks?

You get port.Receive and port.Test to do the same as "let!"

It is right? And are there any benefits in CCR that you don't get with asynchronous F #?

+2


a source to share


1 answer


The example in the mentioned article really looks the same as let!

from asynchronous workflows. In general, the keyword yield return

in C # allows you to code patterns like F #'s evaluation expressions (in a weird way, since it was designed to create counters):

  • This is also used by AsyncEnumerator which is (IMHO) simpler than CCR and a little closer to F # asynchronous workflows
  • I wrote an article that explains this similartiy in more detail.

I think the key difference between CCR and F # asynchronous workflows is that CCR also includes libraries for passing concurrency messaging. See for example in this article - it uses the class Port

(you can send messages to ports) and Arbiter.Receive

, which is a primitive that allows you to wait for messages from Port

.



In F #, you can use MailboxProcessor

to implement the same messaging pattern, but this is not a built-in part of F # asynchronous workflows - it's MailboxProcessor

implemented using asynchronous workflows.

In conclusion . I find F # asynchronous workflows simpler and clearer. However, CCR and asynchronous workflows together MailboxProcessor

implement roughly the same programming pattern.

+4


a source







All Articles