{"id":56055,"date":"2011-04-13T09:36:55","date_gmt":"2011-04-13T09:36:55","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/pfxteam\/2011\/04\/13\/tpl-dataflow-ctp-refresh\/"},"modified":"2011-04-13T09:36:55","modified_gmt":"2011-04-13T09:36:55","slug":"tpl-dataflow-ctp-refresh","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/tpl-dataflow-ctp-refresh\/","title":{"rendered":"TPL Dataflow CTP Refresh"},"content":{"rendered":"<p>Today, we released a new CTP of TPL Dataflow, otherwise known as System.Threading.Tasks.Dataflow.dll.&nbsp; You can download this as part of the <a href=\"https:\/\/msdn.com\/vstudio\/async\">Microsoft Visual Studio Async CTP<\/a>, which will also install the new C#\/Visual Basic support for writing asynchronous methods, or you can install the DLL itself through the installer available on the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/devlabs\/gg585582\">DevLabs site<\/a>.<\/p>\n<p>This new version of the CTP includes a plethora of new features and design changes since the last CTP, many of which were inspired by your feedback and requests:<\/p>\n<ul>\n<li>The source and target interfaces are now co\/contraviarant.&nbsp; For example, you can now connect a BufferBlock&lt;Giraffe&gt; to an ActionBlock&lt;Animal&gt;. <\/li>\n<li>ToObservable and ToObserver extension methods have been added.&nbsp; This enables direct integration between TPL Dataflow and Reactive Extensions, with the ability to expose dataflow sources as observables and dataflow targets as observers.<\/li>\n<li>Most of the blocks now support the setting of explicit bounded capacities through DataflowBlockOptions.&nbsp; For example, you can now construct a TransformBlock&lt;TInput,TOutput&gt; with a bounded capacity of 5, and if the total number of elements in its input buffer, elements currently being processed, and elements in its output buffer is 5, it won&rsquo;t accept any more messages until elements are removed from its output buffer.&nbsp; This allows you to construct long, bounded chains of blocks.<\/li>\n<li>DataflowBlockOptions now has settable properties.&nbsp; This means that to set a single option, you no longer have to also specify all options that came before it in the constructor&rsquo;s parameter list.&nbsp; Additionally, the options have been split into a hierarchy of types (e.g. ExecutionDataflowBlockOptions deriving from DataflowBlockOptions), targeting the specific needs of the block being used. <\/li>\n<li>The ISourceBlock&lt;TOutput&gt; interface has been separated out into two interfaces, a base interface ISourceBlock&lt;TOutput&gt; that provides the core source block support, and a derived interface IReceivableSourceBlock&lt;TOutput&gt; that also enables direct receiving from a block through TryReceive and TryReceiveAll methods. <\/li>\n<li>The DataflowBlockExtensions type has been renamed to DataflowBlock.&nbsp; This helps to highlight all of the methods on DataflowBlock that aren&rsquo;t extensions, e.g. Choose.<\/li>\n<li>The DataflowMessage&lt;T&gt; class has now been replaced by a DataflowMessageHeader struct, and the source and target interfaces have been updated accordingly.&nbsp; This eliminates one of the primary sources of allocations in dataflow networks, resulting in fewer garbage collections and better performance in many scenarios. <\/li>\n<li>Both WriteOnceBlock&lt;T&gt; and BroadcastBlock&lt;T&gt; now allow the cloning function to be optional (by specifying null).&nbsp; This leads to better performance if cloning isn&rsquo;t required. <\/li>\n<li>Grouping blocks (BatchBlock, JoinBlock, BatchedJoinBlock) now allow specification of a maximum-allowed grouping count.&nbsp; These blocks will automatically complete themselves once the grouping count is reached. This replaces the &ldquo;declineAfterOne&rdquo; functionality previously exposed through these blocks. <\/li>\n<li>ITargetBlock&lt;TInput&gt;.Post has been removed from the interface and is now an extension method on DataflowBlock.&nbsp; That&rsquo;s one less method that needs to be implemented by a target block implementer.<\/li>\n<li>IDataflowBlock.CompletionTask has been renamed to IDataflowBlock.Completion, and the ITargetBlock.DeclinePermanently method has been moved down to the base interface and renamed to IDataflowBlock.Complete.&nbsp; <\/li>\n<li>IDataflowBlock now has a Fault method, enabling an external entity to complete the block in a faulted state and with a specific exception. <\/li>\n<li>ConcurrentExclusiveSchedulerPair now has both a Complete method and a Completion Task, enabling signaling to the scheduler that it won&rsquo;t receive any more tasks, and enabling awaiting for all of its processing to complete. <\/li>\n<li>DebuggerDisplay and DebuggerTypeProxy attributes have been updated \/ added to enable better insight into the state of the blocks while debugging. <\/li>\n<li>Many bug fixes (most of which deal with corner cases around interaction with faulty blocks) and some performance enhancements.<\/li>\n<li>An updated, more liberal End-User License Agreement (EULA).<\/li>\n<\/ul>\n<p>We hope you enjoy! And please keep the feedback coming.&nbsp; We love hearing from you.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we released a new CTP of TPL Dataflow, otherwise known as System.Threading.Tasks.Dataflow.dll.&nbsp; You can download this as part of the Microsoft Visual Studio Async CTP, which will also install the new C#\/Visual Basic support for writing asynchronous methods, or you can install the DLL itself through the installer available on the DevLabs site. This [&hellip;]<\/p>\n","protected":false},"author":360,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7908],"tags":[7907,36,7926,7917,7619,7912],"class_list":["post-56055","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pfxteam","tag-net-4","tag-async","tag-dataflow","tag-message-passing","tag-release","tag-task-parallel-library"],"acf":[],"blog_post_summary":"<p>Today, we released a new CTP of TPL Dataflow, otherwise known as System.Threading.Tasks.Dataflow.dll.&nbsp; You can download this as part of the Microsoft Visual Studio Async CTP, which will also install the new C#\/Visual Basic support for writing asynchronous methods, or you can install the DLL itself through the installer available on the DevLabs site. This [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/56055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/360"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=56055"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/56055\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=56055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=56055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=56055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}