var self = Self;
var context = Context;
httpClient.GetAsync(req.Url).ContinueWith(responseTask =>
{
var mylogger = context.ActorSelection("/user/ConsoleLogger");
var response = responseTask.Result;
var duration = stopwatch.Elapsed.TotalMilliseconds;
var msgResponse = new AkkaBlaster.Dto.WebResponse
{
StatusCode = response.StatusCode,
Duration = duration
};
mylogger.Tell("message");
},
TaskContinuationOptions.AttachedToParent & TaskContinuationOptions.ExecuteSynchronously);
Resolve()
, but I will try that!
ResolveOne()
returned null. Waiting 10 seconds (totally arbitrary) resulted in a good reference.
Identify
message that the path is fine.
return context.ActorHasBeenCleared ? null : context;
}
}
ContinueWith()
(for this TPL-style IO handling), you have to be explicit because you simply don't have any current actor context for the calls to work with. shrugs
Tell()
, because of how the normal Tell()
is implemented:
public static void Tell(this IActorRef receiver, object message)
{
var sender = ActorCell.GetCurrentSelfOrNoSender();
receiver.Tell(message, sender);
}
ContinueWith()
that was Akka-aware. Anyway, thanks for the thoughts.