You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
393 B
15 lines
393 B
using Autofac;
|
|
using HybirdFrameworkCore.Autofac;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
|
namespace Service.RealTime;
|
|
|
|
public class HubHolder
|
|
{
|
|
public static IHubContext<MyHub> HubContext { get; set; } = AppInfo.Container.Resolve<IHubContext<MyHub>>();
|
|
|
|
public static async Task S2CMsg(string msg)
|
|
{
|
|
await HubContext.Clients.All.SendAsync("s2cMsg", msg);
|
|
}
|
|
} |