Skip to content

Commit

Permalink
Update JsonStreamController
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvister committed Mar 7, 2018
1 parent a40c6b4 commit da2967a
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions src/Binance/Utility/JsonStreamController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,31 @@

namespace Binance.Utility
{
public class JsonStreamController<TStream> : RetryTaskController, IJsonStreamController<TStream>
where TStream : IJsonStream
public class JsonStreamController : JsonStreamController<IJsonStream>, IJsonStreamController
{
#region Private Constants
#region Public Constants

private readonly TimeSpan _watchdogTimerIntervalDefault = TimeSpan.FromHours(1);
public static readonly TimeSpan WatchdogTimerIntervalDefault = TimeSpan.FromHours(1);

#endregion Private Constants
#endregion Public Constants

#region Constructors

/// <summary>
/// Constructor.
/// </summary>
/// <param name="stream"></param>
/// <param name="logger"></param>
public JsonStreamController(IJsonStream stream, ILogger<JsonStreamController> logger = null)
: base(stream, logger)
{ }

#endregion Constructors
}

public class JsonStreamController<TStream> : RetryTaskController, IJsonStreamController<TStream>
where TStream : IJsonStream
{
#region Public Properties

public TStream Stream { get; }
Expand Down Expand Up @@ -45,7 +61,7 @@ await RestartAsync()
.ConfigureAwait(false);
})
{
Interval = _watchdogTimerIntervalDefault
Interval = JsonStreamController.WatchdogTimerIntervalDefault
};

Stream.Message += (s, e) =>
Expand Down

0 comments on commit da2967a

Please sign in to comment.