Merge pull request #2274 from esdrubal/udpclientreceive
[mono.git] / mcs / class / System.Threading.Tasks.Dataflow / CoreFxSources / Base / ISourceBlock.cs
1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4 // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
5 //
6 // ISourceBlock.cs
7 //
8 //
9 // The base interface for all source blocks.
10 //
11 // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
12
13 using System.Collections.Generic;
14 using System.Diagnostics.CodeAnalysis;
15
16 namespace System.Threading.Tasks.Dataflow
17 {
18     /// <summary>Represents a dataflow block that is a source of data.</summary>
19     /// <typeparam name="TOutput">Specifies the type of data supplied by the <see cref="ISourceBlock{TOutput}"/>.</typeparam>
20     public interface ISourceBlock<out TOutput> : IDataflowBlock
21     {
22         // IMPLEMENT IMPLICITLY
23
24         /// <include file='XmlDocs/CommonXmlDocComments.xml' path='CommonXmlDocComments/Sources/Member[@name="LinkTo"]/*' />
25         IDisposable LinkTo(ITargetBlock<TOutput> target, DataflowLinkOptions linkOptions);
26
27         // IMPLEMENT EXPLICITLY
28
29         /// <include file='XmlDocs/CommonXmlDocComments.xml' path='CommonXmlDocComments/Sources/Member[@name="ConsumeMessage"]/*' />
30         [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#")]
31         TOutput ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock<TOutput> target, out Boolean messageConsumed);
32
33         /// <include file='XmlDocs/CommonXmlDocComments.xml' path='CommonXmlDocComments/Sources/Member[@name="ReserveMessage"]/*' />
34         Boolean ReserveMessage(DataflowMessageHeader messageHeader, ITargetBlock<TOutput> target);
35
36         /// <include file='XmlDocs/CommonXmlDocComments.xml' path='CommonXmlDocComments/Sources/Member[@name="ReleaseReservation"]/*' />
37         void ReleaseReservation(DataflowMessageHeader messageHeader, ITargetBlock<TOutput> target);
38     }
39 }