Created
June 26, 2016 09:53
-
-
Save sliekens/06c14be24eb5bd735ccba28769b9e619 to your computer and use it in GitHub Desktop.
FileDownloadBlock
This file contains hidden or 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
public class FileDownloadBlock : IPropagatorBlock<Uri, Stream> | |
{ | |
private readonly IPropagatorBlock<Uri, Stream> impl = new TransformBlock<Uri, Stream>(new Func<Uri, Stream>(Implementation)); | |
private static Stream Implementation(Uri uri) | |
{ | |
throw new NotImplementedException(); | |
} | |
public DataflowMessageStatus OfferMessage( | |
DataflowMessageHeader messageHeader, | |
Uri messageValue, | |
ISourceBlock<Uri> source, | |
bool consumeToAccept) | |
{ | |
return impl.OfferMessage(messageHeader, messageValue, source, consumeToAccept); | |
} | |
public void Complete() | |
{ | |
impl.Complete(); | |
} | |
public void Fault(Exception exception) | |
{ | |
impl.Fault(exception); | |
} | |
public Task Completion | |
{ | |
get { return impl.Completion; } | |
} | |
public IDisposable LinkTo(ITargetBlock<Stream> target, DataflowLinkOptions linkOptions) | |
{ | |
return impl.LinkTo(target, linkOptions); | |
} | |
public Stream ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock<Stream> target, out bool messageConsumed) | |
{ | |
return impl.ConsumeMessage(messageHeader, target, out messageConsumed); | |
} | |
public bool ReserveMessage(DataflowMessageHeader messageHeader, ITargetBlock<Stream> target) | |
{ | |
return impl.ReserveMessage(messageHeader, target); | |
} | |
public void ReleaseReservation(DataflowMessageHeader messageHeader, ITargetBlock<Stream> target) | |
{ | |
impl.ReleaseReservation(messageHeader, target); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment