public SignalrClient(ILogger <SignalrClient> logger, IOptions <SysOptions> options, IMediator mediator) { _mediator = mediator; _logger = logger; _options = options?.Value; _subscriptions = _options?.SignalrBus?.DefaultTopics; _hub = new HubConnectionBuilder() .WithUrl(_options?.SignalrBus?.HubUrl) //.WithAutomaticReconnect() .Build(); _hub.Closed += OnClose; _hub.On <SignalrMessage>("Sync", async data => { var type = ReflectionUtils.CreateInstanceFromString(data.Type).GetType(); var obj = JObject.Parse(data.JsonData).ToObject(type); await _mediator.Publish(obj); //if( data.SmgType == SignalrMessageTypeEnum.Push ) { //} }); }
protected HubBase(ICurrent current, IOnlineManager onlineManager, ILogger <HubBase> logger, IOptions <SysOptions> sysOptions) { Current = current; OnlineManager = onlineManager; Logger = logger; SysOptions = sysOptions?.Value; }
public PushService(ICurrent current, IOnlineManager onlineManager, ILogger <PushService> logger, ITokenService tokenService, IMediator mediator, IDeviceService deviceService, ITypeFinder typeFinder, ITypeResolve typeResolve, SignalrClient signalrClient, IOptions <SysOptions> options) { _tokenService = tokenService; _mediator = mediator; _deviceService = deviceService; _typeFinder = typeFinder; _typeResolve = typeResolve; _current = current; _onlineManager = onlineManager; _logger = logger; _signalrClient = signalrClient; _options = options?.Value; }
public HealthCheckWorker(IHttpClientFactory httpClientFactory, IOptions <SysOptions> options, ILogger <HealthCheckWorker> logger) { _logger = logger; _options = options?.Value; _httpClientFactory = httpClientFactory; }
public FirewallFilter(ICache cache, ICurrent current, IOptions <SysOptions> options) { _cache = cache; _current = current; _options = options?.Value; }
public SignalrClientWorker(ILogger <SignalrClientWorker> logger, SignalrClient signalrClient, IOptions <SysOptions> options) { _logger = logger; _options = options?.Value; _signalrClient = signalrClient; }