Merge branch 'release/2.1' into dev
This commit is contained in:
commit
277e2963ef
|
|
@ -18,12 +18,7 @@ namespace Microsoft.AspNetCore.Http.Connections
|
||||||
private readonly HttpConnectionDispatcher _dispatcher;
|
private readonly HttpConnectionDispatcher _dispatcher;
|
||||||
private readonly RouteBuilder _routes;
|
private readonly RouteBuilder _routes;
|
||||||
|
|
||||||
/// <summary>
|
internal ConnectionsRouteBuilder(RouteBuilder routes, HttpConnectionDispatcher dispatcher)
|
||||||
/// Initializes a new instance of the <see cref="ConnectionsRouteBuilder"/> class.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="routes">The underlying <see cref="RouteBuilder"/>.</param>
|
|
||||||
/// <param name="dispatcher">The dispatcher.</param>
|
|
||||||
public ConnectionsRouteBuilder(RouteBuilder routes, HttpConnectionDispatcher dispatcher)
|
|
||||||
{
|
{
|
||||||
_routes = routes;
|
_routes = routes;
|
||||||
_dispatcher = dispatcher;
|
_dispatcher = dispatcher;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Http.Connections.Internal
|
namespace Microsoft.AspNetCore.Http.Connections.Internal
|
||||||
{
|
{
|
||||||
public class TimerAwaitable : IDisposable, ICriticalNotifyCompletion
|
internal class TimerAwaitable : IDisposable, ICriticalNotifyCompletion
|
||||||
{
|
{
|
||||||
private Timer _timer;
|
private Timer _timer;
|
||||||
private Action _callback;
|
private Action _callback;
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,8 @@ namespace Microsoft.AspNetCore.SignalR
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets an object that can be used to invoke methods on all connections associated with all of the specified users.
|
/// Gets an object that can be used to invoke methods on all connections associated with all of the specified users.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="users">The user IDs.</param>
|
/// <param name="userIds">The user IDs.</param>
|
||||||
/// <returns>An object that can be used to invoke methods.</returns>
|
/// <returns>An object that can be used to invoke methods.</returns>
|
||||||
public dynamic Users(IReadOnlyList<string> users) => new DynamicClientProxy(_clients.Users(users));
|
public dynamic Users(IReadOnlyList<string> userIds) => new DynamicClientProxy(_clients.Users(userIds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.SignalR
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extension methods for <see cref="IHubClients{T}"/>.
|
/// Extension methods for <see cref="IHubClients{T}"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class IHubClientsExtensions
|
public static class HubClientsExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a <typeparamref name="T" /> that can be used to invoke methods on all clients connected to the hub excluding the specified connection.
|
/// Gets a <typeparamref name="T" /> that can be used to invoke methods on all clients connected to the hub excluding the specified connection.
|
||||||
|
|
@ -16,22 +16,22 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds scale-out to a <see cref="ISignalRServerBuilder"/>, using a shared Redis server.
|
/// Adds scale-out to a <see cref="ISignalRServerBuilder"/>, using a shared Redis server.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="builder">The <see cref="ISignalRServerBuilder"/>.</param>
|
/// <param name="signalrBuilder">The <see cref="ISignalRServerBuilder"/>.</param>
|
||||||
/// <returns>The same instance of the <see cref="ISignalRServerBuilder"/> for chaining.</returns>
|
/// <returns>The same instance of the <see cref="ISignalRServerBuilder"/> for chaining.</returns>
|
||||||
public static ISignalRServerBuilder AddRedis(this ISignalRServerBuilder builder)
|
public static ISignalRServerBuilder AddRedis(this ISignalRServerBuilder signalrBuilder)
|
||||||
{
|
{
|
||||||
return AddRedis(builder, o => { });
|
return AddRedis(signalrBuilder, o => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds scale-out to a <see cref="ISignalRServerBuilder"/>, using a shared Redis server.
|
/// Adds scale-out to a <see cref="ISignalRServerBuilder"/>, using a shared Redis server.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="builder">The <see cref="ISignalRServerBuilder"/>.</param>
|
/// <param name="signalrBuilder">The <see cref="ISignalRServerBuilder"/>.</param>
|
||||||
/// <param name="redisConnectionString">The connection string used to connect to the Redis server.</param>
|
/// <param name="redisConnectionString">The connection string used to connect to the Redis server.</param>
|
||||||
/// <returns>The same instance of the <see cref="ISignalRServerBuilder"/> for chaining.</returns>
|
/// <returns>The same instance of the <see cref="ISignalRServerBuilder"/> for chaining.</returns>
|
||||||
public static ISignalRServerBuilder AddRedis(this ISignalRServerBuilder builder, string redisConnectionString)
|
public static ISignalRServerBuilder AddRedis(this ISignalRServerBuilder signalrBuilder, string redisConnectionString)
|
||||||
{
|
{
|
||||||
return AddRedis(builder, o =>
|
return AddRedis(signalrBuilder, o =>
|
||||||
{
|
{
|
||||||
o.Configuration = ConfigurationOptions.Parse(redisConnectionString);
|
o.Configuration = ConfigurationOptions.Parse(redisConnectionString);
|
||||||
});
|
});
|
||||||
|
|
@ -40,26 +40,26 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds scale-out to a <see cref="ISignalRServerBuilder"/>, using a shared Redis server.
|
/// Adds scale-out to a <see cref="ISignalRServerBuilder"/>, using a shared Redis server.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="builder">The <see cref="ISignalRServerBuilder"/>.</param>
|
/// <param name="signalrBuilder">The <see cref="ISignalRServerBuilder"/>.</param>
|
||||||
/// <param name="configure">A callback to configure the Redis options.</param>
|
/// <param name="configure">A callback to configure the Redis options.</param>
|
||||||
/// <returns>The same instance of the <see cref="ISignalRServerBuilder"/> for chaining.</returns>
|
/// <returns>The same instance of the <see cref="ISignalRServerBuilder"/> for chaining.</returns>
|
||||||
public static ISignalRServerBuilder AddRedis(this ISignalRServerBuilder builder, Action<RedisOptions> configure)
|
public static ISignalRServerBuilder AddRedis(this ISignalRServerBuilder signalrBuilder, Action<RedisOptions> configure)
|
||||||
{
|
{
|
||||||
builder.Services.Configure(configure);
|
signalrBuilder.Services.Configure(configure);
|
||||||
builder.Services.AddSingleton(typeof(HubLifetimeManager<>), typeof(RedisHubLifetimeManager<>));
|
signalrBuilder.Services.AddSingleton(typeof(HubLifetimeManager<>), typeof(RedisHubLifetimeManager<>));
|
||||||
return builder;
|
return signalrBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds scale-out to a <see cref="ISignalRServerBuilder"/>, using a shared Redis server.
|
/// Adds scale-out to a <see cref="ISignalRServerBuilder"/>, using a shared Redis server.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="builder">The <see cref="ISignalRServerBuilder"/>.</param>
|
/// <param name="signalrBuilder">The <see cref="ISignalRServerBuilder"/>.</param>
|
||||||
/// <param name="redisConnectionString">The connection string used to connect to the Redis server.</param>
|
/// <param name="redisConnectionString">The connection string used to connect to the Redis server.</param>
|
||||||
/// <param name="configure">A callback to configure the Redis options.</param>
|
/// <param name="configure">A callback to configure the Redis options.</param>
|
||||||
/// <returns>The same instance of the <see cref="ISignalRServerBuilder"/> for chaining.</returns>
|
/// <returns>The same instance of the <see cref="ISignalRServerBuilder"/> for chaining.</returns>
|
||||||
public static ISignalRServerBuilder AddRedis(this ISignalRServerBuilder builder, string redisConnectionString, Action<RedisOptions> configure)
|
public static ISignalRServerBuilder AddRedis(this ISignalRServerBuilder signalrBuilder, string redisConnectionString, Action<RedisOptions> configure)
|
||||||
{
|
{
|
||||||
return AddRedis(builder, o =>
|
return AddRedis(signalrBuilder, o =>
|
||||||
{
|
{
|
||||||
o.Configuration = ConfigurationOptions.Parse(redisConnectionString);
|
o.Configuration = ConfigurationOptions.Parse(redisConnectionString);
|
||||||
configure(o);
|
configure(o);
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,12 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="THub">The hub type to configure.</typeparam>
|
/// <typeparam name="THub">The hub type to configure.</typeparam>
|
||||||
/// <param name="signalrBuilder">The <see cref="ISignalRServerBuilder"/>.</param>
|
/// <param name="signalrBuilder">The <see cref="ISignalRServerBuilder"/>.</param>
|
||||||
/// <param name="options">A callback to configure the hub options.</param>
|
/// <param name="configure">A callback to configure the hub options.</param>
|
||||||
/// <returns>The same instance of the <see cref="ISignalRServerBuilder"/> for chaining.</returns>
|
/// <returns>The same instance of the <see cref="ISignalRServerBuilder"/> for chaining.</returns>
|
||||||
public static ISignalRServerBuilder AddHubOptions<THub>(this ISignalRServerBuilder signalrBuilder, Action<HubOptions<THub>> options) where THub : Hub
|
public static ISignalRServerBuilder AddHubOptions<THub>(this ISignalRServerBuilder signalrBuilder, Action<HubOptions<THub>> configure) where THub : Hub
|
||||||
{
|
{
|
||||||
signalrBuilder.Services.AddSingleton<IConfigureOptions<HubOptions<THub>>, HubOptionsSetup<THub>>();
|
signalrBuilder.Services.AddSingleton<IConfigureOptions<HubOptions<THub>>, HubOptionsSetup<THub>>();
|
||||||
signalrBuilder.Services.Configure(options);
|
signalrBuilder.Services.Configure(configure);
|
||||||
return signalrBuilder;
|
return signalrBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,11 +44,11 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
/// Adds SignalR services to the specified <see cref="IServiceCollection" />.
|
/// Adds SignalR services to the specified <see cref="IServiceCollection" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
|
/// <param name="services">The <see cref="IServiceCollection" /> to add services to.</param>
|
||||||
/// <param name="options">An <see cref="Action{MvcOptions}"/> to configure the provided <see cref="HubOptions"/>.</param>
|
/// <param name="configure">An <see cref="Action{MvcOptions}"/> to configure the provided <see cref="HubOptions"/>.</param>
|
||||||
/// <returns>An <see cref="ISignalRServerBuilder"/> that can be used to further configure the SignalR services.</returns>
|
/// <returns>An <see cref="ISignalRServerBuilder"/> that can be used to further configure the SignalR services.</returns>
|
||||||
public static ISignalRServerBuilder AddSignalR(this IServiceCollection services, Action<HubOptions> options)
|
public static ISignalRServerBuilder AddSignalR(this IServiceCollection services, Action<HubOptions> configure)
|
||||||
{
|
{
|
||||||
return services.Configure(options)
|
return services.Configure(configure)
|
||||||
.AddSignalR();
|
.AddSignalR();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue