-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
195 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Version>0.1.0</Version> | ||
<LangVersion>8</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<NoWarn>1591</NoWarn> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using System.Threading.Tasks.Dataflow; | ||
|
||
namespace BiDaFlow.Blocks | ||
{ | ||
internal sealed class ToTargetBlockBlock<T> : ITargetBlock<T> | ||
{ | ||
private readonly ITargetBlock<T> _sourceBlock; | ||
private readonly IDataflowBlock _targetBlock; | ||
|
||
public ToTargetBlockBlock(ITargetBlock<T> sourceBlock, IDataflowBlock targetBlock) | ||
{ | ||
this._sourceBlock = sourceBlock; | ||
this._targetBlock = targetBlock; | ||
} | ||
|
||
public Task Completion => this._targetBlock.Completion; | ||
|
||
public void Complete() => this._sourceBlock.Complete(); | ||
|
||
public void Fault(Exception exception) => this._sourceBlock.Fault(exception); | ||
|
||
public DataflowMessageStatus OfferMessage(DataflowMessageHeader messageHeader, T messageValue, ISourceBlock<T> source, bool consumeToAccept) | ||
=> this._sourceBlock.OfferMessage(messageHeader, messageValue, source, consumeToAccept); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Version>0.1.0</Version> | ||
<AssemblyVersion>0.1.0.0</AssemblyVersion> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<Import Project="..\Directory.Build.props" /> | ||
</Project> |