Browse Source

Use IServiceScopeFactory instead of IHybridServiceScopeFactory for event bus.

pull/1406/head
Halil İbrahim Kalkan 7 years ago
parent
commit
f719bda32f
  1. 1
      framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueManager.cs
  2. 3
      framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs
  3. 9
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs
  4. 7
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs
  5. 4
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IocEventHandlerFactory.cs
  6. 3
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs

1
framework/src/Volo.Abp.BackgroundJobs.RabbitMQ/Volo/Abp/BackgroundJobs/RabbitMQ/JobQueueManager.cs

@ -14,6 +14,7 @@ namespace Volo.Abp.BackgroundJobs.RabbitMQ
protected ConcurrentDictionary<string, IRunnable> JobQueues { get; } protected ConcurrentDictionary<string, IRunnable> JobQueues { get; }
protected IServiceProvider ServiceProvider { get; } protected IServiceProvider ServiceProvider { get; }
protected BackgroundJobOptions Options { get; } protected BackgroundJobOptions Options { get; }
public JobQueueManager( public JobQueueManager(

3
framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs

@ -3,6 +3,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using RabbitMQ.Client; using RabbitMQ.Client;
using RabbitMQ.Client.Events; using RabbitMQ.Client.Events;
@ -36,7 +37,7 @@ namespace Volo.Abp.EventBus.RabbitMq
IOptions<RabbitMqEventBusOptions> options, IOptions<RabbitMqEventBusOptions> options,
IConnectionPool connectionPool, IConnectionPool connectionPool,
IRabbitMqSerializer serializer, IRabbitMqSerializer serializer,
IHybridServiceScopeFactory serviceScopeFactory, IServiceScopeFactory serviceScopeFactory,
IOptions<DistributedEventBusOptions> distributedEventBusOptions, IOptions<DistributedEventBusOptions> distributedEventBusOptions,
IRabbitMqMessageConsumerFactory messageConsumerFactory) IRabbitMqMessageConsumerFactory messageConsumerFactory)
: base(serviceScopeFactory) : base(serviceScopeFactory)

9
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Distributed/LocalDistributedEventBus.cs

@ -1,6 +1,7 @@
using System; using System;
using System.Reflection; using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Volo.Abp.Collections; using Volo.Abp.Collections;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
@ -10,15 +11,17 @@ namespace Volo.Abp.EventBus.Distributed
{ {
[Dependency(TryRegister = true)] [Dependency(TryRegister = true)]
[ExposeServices(typeof(IDistributedEventBus), typeof(LocalDistributedEventBus))] [ExposeServices(typeof(IDistributedEventBus), typeof(LocalDistributedEventBus))]
public class LocalDistributedEventBus : IDistributedEventBus, ISingletonDependency public class LocalDistributedEventBus : IDistributedEventBus, ITransientDependency
{ {
private readonly ILocalEventBus _localEventBus; private readonly ILocalEventBus _localEventBus;
protected IHybridServiceScopeFactory ServiceScopeFactory { get; }
protected IServiceScopeFactory ServiceScopeFactory { get; }
protected DistributedEventBusOptions DistributedEventBusOptions { get; } protected DistributedEventBusOptions DistributedEventBusOptions { get; }
public LocalDistributedEventBus( public LocalDistributedEventBus(
ILocalEventBus localEventBus, ILocalEventBus localEventBus,
IHybridServiceScopeFactory serviceScopeFactory, IServiceScopeFactory serviceScopeFactory,
IOptions<DistributedEventBusOptions> distributedEventBusOptions) IOptions<DistributedEventBusOptions> distributedEventBusOptions)
{ {
_localEventBus = localEventBus; _localEventBus = localEventBus;

7
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBusBase.cs

@ -1,13 +1,12 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Collections; using Volo.Abp.Collections;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Reflection; using Volo.Abp.Reflection;
@ -15,9 +14,9 @@ namespace Volo.Abp.EventBus
{ {
public abstract class EventBusBase : IEventBus public abstract class EventBusBase : IEventBus
{ {
protected IHybridServiceScopeFactory ServiceScopeFactory { get; } protected IServiceScopeFactory ServiceScopeFactory { get; }
protected EventBusBase(IHybridServiceScopeFactory serviceScopeFactory) protected EventBusBase(IServiceScopeFactory serviceScopeFactory)
{ {
ServiceScopeFactory = serviceScopeFactory; ServiceScopeFactory = serviceScopeFactory;
} }

4
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IocEventHandlerFactory.cs

@ -14,9 +14,9 @@ namespace Volo.Abp.EventBus
{ {
public Type HandlerType { get; } public Type HandlerType { get; }
protected IHybridServiceScopeFactory ScopeFactory { get; } protected IServiceScopeFactory ScopeFactory { get; }
public IocEventHandlerFactory(IHybridServiceScopeFactory scopeFactory, Type handlerType) public IocEventHandlerFactory(IServiceScopeFactory scopeFactory, Type handlerType)
{ {
ScopeFactory = scopeFactory; ScopeFactory = scopeFactory;
HandlerType = handlerType; HandlerType = handlerType;

3
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/Local/LocalEventBus.cs

@ -6,6 +6,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Threading; using Volo.Abp.Threading;
@ -28,7 +29,7 @@ namespace Volo.Abp.EventBus.Local
public LocalEventBus( public LocalEventBus(
IOptions<LocalEventBusOptions> options, IOptions<LocalEventBusOptions> options,
IHybridServiceScopeFactory serviceScopeFactory) IServiceScopeFactory serviceScopeFactory)
: base(serviceScopeFactory) : base(serviceScopeFactory)
{ {
Options = options.Value; Options = options.Value;

Loading…
Cancel
Save