Aaronontheweb on 1.4.14
Aaronontheweb on master
Bump Mongo2Go from 2.2.14 to 2.… Bump MongoDB.Driver from 2.11.4… Bump Microsoft.NET.Test.Sdk fro… and 4 more (compare)
Aaronontheweb on 1.4.14
Aaronontheweb on dev
Added v1.4.14 release notes (#1… (compare)
Peer terminated
is printed. However, if I'm too fast to restart the killed instance running on the same port, the first one gets confused, spits out the errors above and the Terminated message is not received.
AwaitTermination
after the Shutdown
call fixes it both in 1.0.4 and 1.0.5 if I stop it gracefully. When killing it hard, even in 1.0.5 the behavior is same though. Of course when under my control I can try to gracefully close it down, but what if it crashes on me and gets restarted automatically ?
using (var client = new HttpClient())
{
var request = new HttpRequestMessage(msg.HttpMethod, msg.Uri);
client
.SendAsync(request)
.PipeTo(Self);
}
@mmisztal1980 you can create a custom response wrapper in SendAsync
continuation like:
using (var client = new HttpClient())
{
var request = new HttpRequestMessage(msg.HttpMethod, msg.Uri);
var start = DateTime.UtcNow;
client
.SendAsync(request)
.ContinueWith(task => !(task.IsCancelled || task.IsFaulted) ? new SuccessfulResponse(task.Result, start: start, stop: DateTime.UtcNow) : new FailedResponse(task.Result, start: start, stop: DateTime.UtcNow) ,
TaskContinuationOptions.AttachedToParent|TaskContinuationOptions.ExecuteSynchronously)
.PipeTo(Self);
}
Task continuation options are used here to not spawn separate tasks for one simple operation (creating message wrapper), we attach it to task running SendAsync instead.