From 357f5f85bbc7b794f95bcb63799f98bc1dcee68e Mon Sep 17 00:00:00 2001 From: moozzyk Date: Tue, 8 Nov 2016 13:14:56 -0800 Subject: [PATCH] Minor cleanup --- samples/SocialWeather/{ => Json}/JSonStreamFormatter.cs | 2 +- samples/SocialWeather/SocialWeatherEndPoint.cs | 6 ------ samples/SocialWeather/Startup.cs | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) rename samples/SocialWeather/{ => Json}/JSonStreamFormatter.cs (96%) diff --git a/samples/SocialWeather/JSonStreamFormatter.cs b/samples/SocialWeather/Json/JSonStreamFormatter.cs similarity index 96% rename from samples/SocialWeather/JSonStreamFormatter.cs rename to samples/SocialWeather/Json/JSonStreamFormatter.cs index a6a1566fb1..67de693282 100644 --- a/samples/SocialWeather/JSonStreamFormatter.cs +++ b/samples/SocialWeather/Json/JSonStreamFormatter.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using Newtonsoft.Json; -namespace SocialWeather +namespace SocialWeather.Json { public class JsonStreamFormatter : IStreamFormatter { diff --git a/samples/SocialWeather/SocialWeatherEndPoint.cs b/samples/SocialWeather/SocialWeatherEndPoint.cs index 858091705a..96b9f1cf50 100644 --- a/samples/SocialWeather/SocialWeatherEndPoint.cs +++ b/samples/SocialWeather/SocialWeatherEndPoint.cs @@ -10,8 +10,6 @@ namespace SocialWeather private readonly PersistentConnectionLifeTimeManager _lifetimeManager; private readonly FormatterResolver _formatterResolver; private readonly ILogger _logger; - private object _lockObj = new object(); - private WeatherReport _lastWeatherReport; public SocialWeatherEndPoint(PersistentConnectionLifeTimeManager lifetimeManager, FormatterResolver formatterResolver, ILogger logger) @@ -37,10 +35,6 @@ namespace SocialWeather WeatherReport weatherReport; while ((weatherReport = await formatter.ReadAsync(stream)) != null) { - lock(_lockObj) - { - _lastWeatherReport = weatherReport; - } await _lifetimeManager.SendToAllAsync(weatherReport); } } diff --git a/samples/SocialWeather/Startup.cs b/samples/SocialWeather/Startup.cs index b5cbdd02ff..2380f83a2d 100644 --- a/samples/SocialWeather/Startup.cs +++ b/samples/SocialWeather/Startup.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using SocialWeather.Json; using SocialWeather.Pipe; using SocialWeather.Protobuf;