Skip to content

Commit 59c9160

Browse files
dwybandwyban
authored andcommitted
Fixed some documentation comments.
Made the epoch DateTime a private readonly of ISStreamer rather than generate it every time.
1 parent 786efec commit 59c9160

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

InitialState.NET/ISEventData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace InitialState.Streaming
2323
{
2424
/// <summary>
25-
/// Represents an Initial State Event Data point which can be added to a <see cref="ISEventDataCollection"/> to be sent to an Initial State Event Data Stream using a <see cref="ISStreamer"/>.
25+
/// Represents an Initial State Event Data point which can be added to a <see cref="ISEventDataCollection"/> to be sent to an Initial State Event Data Stream using an <see cref="ISStreamer"/>.
2626
/// </summary>
2727
public class ISEventData
2828
{

InitialState.NET/ISEventDataCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
namespace InitialState.Streaming
2424
{
2525
/// <summary>
26-
/// Represents a collection of <see cref="ISEventData"/> objects that are ready to be sent to and Initial State Event Stream using an <see cref="ISStreamer"/>.
26+
/// Represents a collection of <see cref="ISEventData"/> objects that are ready to be sent to an Initial State Event Stream using an <see cref="ISStreamer"/>.
2727
/// </summary>
2828
[System.ComponentModel.ListBindable(false)]
2929
public class ISEventDataCollection : System.Collections.Generic.IList<ISEventData>

InitialState.NET/ISStreamer.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public enum CreateBucketStatus
5151
//---------------
5252
private HttpClient _httpClient = null;
5353
private StringBuilder _jsonStrBuilder = null;
54+
private readonly DateTime _epochDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);
5455

5556
// Properties
5657
//-----------
@@ -80,9 +81,10 @@ public enum CreateBucketStatus
8081
/// <summary>
8182
/// Initializes a new instance of the <see cref="ISStreamer"/> class.
8283
/// </summary>
84+
/// <remarks>Uses the default API base address https://groker.init.st/api/</remarks>
8385
public ISStreamer() : this("https://groker.init.st/api/") { }
8486
/// <summary>
85-
/// Initializes a new instance of the <see cref="ISStreamer"/> class with a specified api base address.
87+
/// Initializes a new instance of the <see cref="ISStreamer"/> class with a specified API base address.
8688
/// </summary>
8789
/// <param name="apiBaseAddress">The URL where InitalState API calls will be made.</param>
8890
public ISStreamer(string apiBaseAddress)
@@ -96,7 +98,7 @@ public ISStreamer(string apiBaseAddress)
9698
// Public Methods
9799
//---------------
98100
/// <summary>
99-
/// Connects to an Initial State Event Data bucket for streaming.
101+
/// Connects the <see cref="ISStreamer"/> to an Event Data Bucket for streaming.
100102
/// </summary>
101103
/// <param name="accessKey">The access key that will be used to access the Initial State API.</param>
102104
/// <param name="bucketKey">The bucket key that identifies the Initial State Event Data bucket to which event data will be streamed.</param>
@@ -119,7 +121,7 @@ public void ConnectBucket(string accessKey, string bucketKey)
119121
}
120122

121123
/// <summary>
122-
/// Creates and connects the to a new event data bucket for streaming.
124+
/// Creates and connects the <see cref="ISStreamer"/> to a new Event Data Bucket for streaming.
123125
/// </summary>
124126
/// <param name="accessKey">The access key that will be used to access the Initial State API.</param>
125127
/// <param name="bucketKey">The bucket key that identifies the Initial State event data bucket to which data will be streamed.</param>
@@ -243,8 +245,8 @@ public CreateBucketStatus CreateBucket(string accessKey, string bucketKey, strin
243245
int.TryParse(response.Headers.GetValues("X-RateLimit-Limit").First(), out sr.RateLimit);
244246
int.TryParse(response.Headers.GetValues("X-RateLimit-Remaining").First(), out sr.RateLimitRemaining);
245247
int.TryParse(response.Headers.GetValues("X-RateLimit-Reset").First(), out int epochTimestamp);
246-
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0);
247-
sr.RateLimitReset = epoch.AddSeconds(epochTimestamp).ToLocalTime();
248+
249+
sr.RateLimitReset = _epochDateTime.AddSeconds(epochTimestamp).ToLocalTime();
248250

249251
// Data is sent so clear out the buffer
250252
if (sr.Success)

0 commit comments

Comments
 (0)