Capturing Sender into local variable makes no sense here. PipeTo is executed sync. If we were to use Sender in ContinueWith lambda, then it would be necessary to capture, but why capture it here? This confuses me. And the importance of capturing Sender is repeated many times on different pages. Makes me think that either I am missing smth, or whoever wrote this made a mistake.
Receive<BeginProcessFeed>(feed =>
{
//instance variable for closure
var senderClosure = Sender;
SendMessage(string.Format("Downloading {0} for RSS/ATOM processing...", feed.FeedUri));
//reply back to the sender
_feedFactory.CreateFeedAsync(feed.FeedUri).PipeTo(senderClosure);
});
Capturing Sender into local variable makes no sense here. PipeTo is executed sync. If we were to use Sender in ContinueWith lambda, then it would be necessary to capture, but why capture it here? This confuses me. And the importance of capturing Sender is repeated many times on different pages. Makes me think that either I am missing smth, or whoever wrote this made a mistake.