Skip to content

Commit

Permalink
assorted style and formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
withakay committed Apr 26, 2019
1 parent 7e92f1a commit 616b3ef
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/IO.Ably.Shared/AblyAuth.cs
Expand Up @@ -246,7 +246,8 @@ public virtual async Task<TokenDetails> RequestTokenAsync(TokenParams tokenParam

throw new AblyException(
new ErrorInfo(
"Error calling AuthCallback, token request failed. See inner exception for details.", 80019,
"Error calling AuthCallback, token request failed. See inner exception for details.",
80019,
statusCode), ex);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/IO.Ably.Shared/AblyAuthUpdatedEventArgs.cs
Expand Up @@ -19,7 +19,8 @@ public AblyAuthUpdatedEventArgs()
CompletedTask = new TaskCompletionSource<bool>();
}

public AblyAuthUpdatedEventArgs(TokenDetails token) : this()
public AblyAuthUpdatedEventArgs(TokenDetails token)
: this()
{
Token = token;
}
Expand Down
2 changes: 1 addition & 1 deletion src/IO.Ably.Shared/ClientOptions.cs
Expand Up @@ -268,7 +268,7 @@ private void Init()
internal void SetIdempotentRestPublishingDefault(int majorVersion, int minorVersion)
{
// (TO3n) idempotentRestPublishing defaults to false for clients with version < 1.1, otherwise true.
if (majorVersion == 1 && minorVersion >= 1 || majorVersion > 1)
if ((majorVersion == 1 && minorVersion >= 1) || majorVersion > 1)
{
IdempotentRestPublishing = true;
}
Expand Down
3 changes: 1 addition & 2 deletions src/IO.Ably.Shared/PaginatedRequestParams.cs
Expand Up @@ -120,8 +120,7 @@ internal void Validate()
var result = new List<KeyValuePair<string, string>>();
if (Start.HasValue)
{
result.Add(new KeyValuePair<string, string>("start",
Start.Value.ToUnixTimeInMilliseconds().ToString()));
result.Add(new KeyValuePair<string, string>("start", Start.Value.ToUnixTimeInMilliseconds().ToString()));
}

if (End.HasValue)
Expand Down
6 changes: 4 additions & 2 deletions src/IO.Ably.Shared/Realtime/RealtimeChannel.cs
Expand Up @@ -620,7 +620,8 @@ private void HandleStateChange(ChannelState state, ErrorInfo error, ProtocolMess

private void Reattach(ErrorInfo error, ProtocolMessage msg)
{
Task.Run(async () =>
TaskUtils.RunInBackground(
() =>
{
try
{
Expand All @@ -640,7 +641,8 @@ private void Reattach(ErrorInfo error, ProtocolMessage msg)
{
Logger.Error("Reattach channel failed; channel = " + Name, e);
}
});
},
e => Logger.Warning(e.Message));
}

/// <summary>
Expand Down
Expand Up @@ -10,7 +10,6 @@ namespace IO.Ably.Transport.States.Connection
internal class ConnectionConnectingState : ConnectionStateBase
{
private readonly ICountdownTimer _timer;
private readonly ConnectionStateBase _previous;

public ConnectionConnectingState(IConnectionContext context, ILogger logger)
: this(context, new CountdownTimer("Connecting state timer", logger), logger)
Expand Down
4 changes: 1 addition & 3 deletions src/IO.Ably.Shared/Types/ProtocolMessage.cs
Expand Up @@ -8,8 +8,6 @@ namespace IO.Ably.Types
{
public class ProtocolMessage
{
private string _connectionKey;

public enum MessageAction
{
Heartbeat = 0,
Expand Down Expand Up @@ -122,7 +120,7 @@ internal ProtocolMessage(MessageAction action, string channel)
internal bool AckRequired => Action == MessageAction.Message || Action == MessageAction.Presence;

[OnSerializing]
internal void OnSerializing(StreamingContext context)
private void OnSerializing(StreamingContext context)
{
if (Channel == string.Empty)
{
Expand Down
4 changes: 3 additions & 1 deletion src/IO.Ably.Shared/Utils/TaskUtils.cs
Expand Up @@ -53,9 +53,11 @@ public static Task<object> Convert<T>(this Task<T> task)
public static void RunInBackground(Action action, Action<Exception> handler = null)
{
if (action == null)
{
throw new ArgumentNullException(nameof(action));
}

var task = Task.Run(action); // Adapt as necessary for .NET 4.0.
var task = Task.Run(action);

if (handler == null)
{
Expand Down

0 comments on commit 616b3ef

Please sign in to comment.