C# BufferBlock that keeps unique items
If you're aiming for KISS at the level of maintenance, this looks like a reasonable solution, although there are some minor details which IMO could be improved.


public class UniqueBufferBlock
{
    private readonly BufferBlock&lt;string&gt; _buffer = new BufferBlock&lt;string&gt;();
    private readonly HashSet&lt;string&gt; _hashSet = new HashSet&lt;string&gt;();



Why not genericise the class?


    public string Recieve()



Fix that spelling. Incorrectly spelt names are one of the banes of the maintenance programmer.


    public Task&lt;bool&gt; OutputAvailable(CancellationToken cancelToken)



Follow conventions: this should have a name ending Async, like the method it wraps.



There are a couple of other directions which might be worth considering. One is to go the full hog and implement IPropagatorBlock. The other is to slim down the dependencies by removing _buffer and implementing OutputAvailableAsync with TaskCompletionSource. Both would make the implementation of UniqueBufferBlock more fiddly, and it's reasonable to decide not to go in either direction.



PS on a point of English language pedantry: distinct is a better choice of word than unique. Perhaps deduplicated would be better still in this context.