Ejemplo n.º 1
0
 public ServarrHubProxy(
     IHubConnectionFactory connectionFactory,
     ILogger <ServarrHubProxy> logger)
 {
     _connection = connectionFactory.GetOrCreate();
     _logger     = logger;
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 5
0
        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);
            };
        }
Ejemplo n.º 6
0
 public static HubConnection GetOrCreate(this IHubConnectionFactory factory)
 => factory.GetOrCreate(HubConnectionOptions.DefaultName);
Ejemplo n.º 7
0
 public ConnectionManager(IHubConnectionFactory connectionFactory, ILogger <ConnectionManager> logger)
 {
     _logger     = logger;
     _connection = connectionFactory.GetOrCreate();
 }
Ejemplo n.º 8
0
 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();
 }
Ejemplo n.º 9
0
 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)
 {
 }