Skip to content

Commit

Permalink
Expose ClientManager in ServerlessHub (#256) (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Sindo authored Jul 16, 2021
2 parents 264cab8 + cb2ccf4 commit 65369bf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/SignalRServiceExtension/TriggerBindings/ServerlessHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public abstract class ServerlessHub : IDisposable
{
private static readonly Lazy<JwtSecurityTokenHandler> JwtSecurityTokenHandler = new Lazy<JwtSecurityTokenHandler>(() => new JwtSecurityTokenHandler());
private bool _disposed;
/// <summary>
/// Might be converted from <see cref="IServiceHubContext"/>, don't forget to test null before use it.
/// </summary>
private readonly ServiceHubContext _hubContext;
private readonly IServiceManager _serviceManager;

Expand All @@ -44,6 +47,7 @@ protected ServerlessHub(IServiceHubContext hubContext = null, IServiceManager se
Groups = hubContext.Groups;
UserGroups = hubContext.UserGroups;
_hubContext = hubContext as ServiceHubContext;
ClientManager = _hubContext?.ClientManager;
}

/// <summary>
Expand All @@ -61,6 +65,11 @@ protected ServerlessHub(IServiceHubContext hubContext = null, IServiceManager se
/// </summary>
public IUserGroupManager UserGroups { get; }

/// <summary>
/// Get the client manager of this hub.
/// </summary>
public ClientManager ClientManager { get; }

/// <summary>
/// Get the hub name of this hub.
/// </summary>
Expand Down

0 comments on commit 65369bf

Please sign in to comment.