Skip to content

Commit

Permalink
Changing subscription state visibility. (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoakbuilds authored Jul 12, 2021
1 parent 0d06adb commit 540890b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Solnet.Rpc/Core/Sockets/SubscriptionState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public abstract class SubscriptionState
/// </summary>
/// <param name="rpcClient">The streaming rpc client reference.</param>
/// <param name="chan">The channel of this subscription.</param>
/// <param name="aditionalParameters">Aditional parameters for this given subscription.</param>
protected SubscriptionState(IStreamingRpcClient rpcClient, SubscriptionChannel chan, IList<object> aditionalParameters = default)
/// <param name="aditionalParameters">Additional parameters for this given subscription.</param>
protected SubscriptionState(IStreamingRpcClient rpcClient, SubscriptionChannel chan, IList<object> additionalParameters = default)
{
_rpcClient = rpcClient;
Channel = chan;
AdditionalParameters = aditionalParameters?.ToImmutableList();
AdditionalParameters = additionalParameters?.ToImmutableList();
}

/// <summary>
Expand All @@ -86,7 +86,7 @@ internal void ChangeState(SubscriptionStatus newState, string error = null, stri
/// Invokes the data handler.
/// </summary>
/// <param name="data">The data.</param>
internal abstract void HandleData(object data);
protected internal abstract void HandleData(object data);

/// <summary>
/// Unsubscribes the current subscription.
Expand Down Expand Up @@ -114,14 +114,14 @@ internal class SubscriptionState<T> : SubscriptionState
/// <param name="rpcClient">The streaming rpc client reference.</param>
/// <param name="chan">The channel of this subscription.</param>
/// <param name="handler">The handler for the data received.</param>
/// <param name="aditionalParameters">Aditional parameters for this given subscription.</param>
internal SubscriptionState(SolanaStreamingRpcClient rpcClient, SubscriptionChannel chan, Action<SubscriptionState, T> handler, IList<object> aditionalParameters = default)
: base(rpcClient, chan, aditionalParameters)
/// <param name="additionalParameters">Additional parameters for this given subscription.</param>
internal SubscriptionState(SolanaStreamingRpcClient rpcClient, SubscriptionChannel chan, Action<SubscriptionState, T> handler, IList<object> additionalParameters = default)
: base(rpcClient, chan, additionalParameters)
{
DataHandler = handler;
}

/// <inheritdoc cref="SubscriptionState.HandleData(object)"/>
internal override void HandleData(object data) => DataHandler(this, (T)data);
protected internal override void HandleData(object data) => DataHandler(this, (T)data);
}
}

0 comments on commit 540890b

Please sign in to comment.