I work with Streaming with WCF, and I have a question about what the paragraph on " Enabling asynchronous streaming " means from the MSDN article on Big Data and Streaming in WCF.
To enable asynchronous streaming, add the DispatcherSynchronizationBehavior endpoint behavior for the host service and set the AsynchronousSendEnabled property to true . We have also added the ability to true asynchronous streaming on the sending side. This improves the scalability of the service in scenarios where it streams messages to multiple clients, some of which are slow in possibly due to network congestion or not read at all. In these scenarios, we no longer block individual service flows per customer. This ensures that the service will be able to handle many clients, thereby improving the scalability of the service.
I understand that this means that I am adding
<behaviors> <endpointBehaviors> <behavior name="AsyncStreaming"> <dispatcherSynchronization asynchronousSendEnabled="true" /> </behavior> </endpointBehaviors> ...
To my web.config and referring to the behavior of AsyncStreaming at my endpoint, however I do not understand what these steps do for me. Do I need to modify the code at all to take advantage of this asynchrony?
Also on a similar topic (but if it is too different, I will transfer it to a new question), how to use the async / await effect using Streams in WCF? Can I make Task<Stream> Foo() in my service contract? I am making some database calls, the results of which are eventually transferred to the user stream, which I will return from the WCF service. Being able to use things like ExecuteDataReaderAsync() is very useful, can I use it when working with streaming rather than buffered messages?
I tested it, and I know that it "works" using "Tasks", but I do not know if this will cause the function to return to the "Buffering" mode, for example, when you provide functions with more than one parameter (see 3rd paragraph " " Programming Model for Streaming Broadcasts "on the same MSDN page), and I donβt know how to check if this is happening.
source share