public ServarrHubProxy( IHubConnectionFactory connectionFactory, ILogger <ServarrHubProxy> logger) { _connection = connectionFactory.GetOrCreate(); _logger = logger; }
protected MessageClient(IHubConnectionFactory connector, string targetService, IIdentityProvider identityProvider, bool useEvents) { this.connector = connector; this.targetService = targetService; isBidirectional = useEvents; this.useEvents = useEvents; this.identityProvider = identityProvider; ReConnectClient(); }
public ServarrClient(IHubConnectionFactory connectionFactory, ILogger <ServarrClient> logger) { _logger = logger; var connection = connectionFactory.GetOrCreate(); connection.On <CancellationToken>(nameof(GetApiKeyAsync), GetApiKeyAsync); connection.On <IndexRequest, CancellationToken>(nameof(ShouldImportAsync), ShouldImportAsync); connection.On <IndexRequest, CancellationToken>(nameof(ImportAsync), ImportAsync); }
public TaskRunnerRegistryProxy( IHubConnectionFactory hubConnectionFactory, ILogger logger) : base(logger) { var connection = hubConnectionFactory?.Create() ?? throw new ArgumentNullException(nameof(hubConnectionFactory)); connection.On <int, TaskRunnerState>(nameof(ITaskRunnerClient.StateUpdated), SignalStateUpdated); connection.On <int, object?>(nameof(ITaskRunnerClient.ProgressUpdated), SignalProgressUpdated); ActiveConnection = Activate(); async Task <HubConnection> Activate() { await connection.StartAsync().ConfigureAwait(false); return(connection); } }
public MetaReporterClient(IHubConnectionFactory factory) { BaseConnection = factory?.GetConnection(IMetaReporterHub.Path) ?? throw new ArgumentNullException(nameof(factory)); BaseConnection.Reconnected += s => { IsConncted = true; Register(); return(Task.CompletedTask); }; BaseConnection.Closed += s => { IsConncted = false; return(Task.CompletedTask); }; }
public static HubConnection GetOrCreate(this IHubConnectionFactory factory) => factory.GetOrCreate(HubConnectionOptions.DefaultName);
public ConnectionManager(IHubConnectionFactory connectionFactory, ILogger <ConnectionManager> logger) { _logger = logger; _connection = connectionFactory.GetOrCreate(); }
public MessageServer(IHubConnectionFactory hubFactory, IDictionary <string, object> exposedObjects, bool useExtendedProxying, bool useSecurity, ICustomServerSecurity security) : base(exposedObjects, useExtendedProxying, useSecurity, security) { this.hubFactory = hubFactory; reconnector = new Timer(TryReconnect, null, Timeout.Infinite, Timeout.Infinite); ConnectToHub(); }
public MessageServer(IHubConnectionFactory hubFactory, PluginFactory factory, bool useExtendedProxying, bool useSecurity, ICustomServerSecurity security) : base(factory, useExtendedProxying, useSecurity, security) { this.hubFactory = hubFactory; reconnector = new Timer(TryReconnect, null, Timeout.Infinite, Timeout.Infinite); ConnectToHub(); }
public TaskRunnerRegistryProxy( IHubConnectionFactory <TaskRunnerRegistryProxy> hubConnectionFactory, ILogger <TaskRunnerRegistryProxy> logger) : this(hubConnectionFactory, logger as ILogger) { }