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 IServiceProvider ServiceProvider { get; }
protected BackgroundJobOptions Options { get; }
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.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
@ -36,7 +37,7 @@ namespace Volo.Abp.EventBus.RabbitMq
IOptions<RabbitMqEventBusOptions> options,
IConnectionPool connectionPool,
IRabbitMqSerializer serializer,
IHybridServiceScopeFactory serviceScopeFactory,
IServiceScopeFactory serviceScopeFactory,
IOptions<DistributedEventBusOptions> distributedEventBusOptions,
IRabbitMqMessageConsumerFactory messageConsumerFactory)
: base(serviceScopeFactory)

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

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

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

@ -1,13 +1,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Collections;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Reflection;
@ -15,9 +14,9 @@ namespace Volo.Abp.EventBus
{
public abstract class EventBusBase : IEventBus
{
protected IHybridServiceScopeFactory ServiceScopeFactory { get; }
protected IServiceScopeFactory ServiceScopeFactory { get; }
protected EventBusBase(IHybridServiceScopeFactory serviceScopeFactory)
protected EventBusBase(IServiceScopeFactory 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; }
protected IHybridServiceScopeFactory ScopeFactory { get; }
protected IServiceScopeFactory ScopeFactory { get; }
public IocEventHandlerFactory(IHybridServiceScopeFactory scopeFactory, Type handlerType)
public IocEventHandlerFactory(IServiceScopeFactory scopeFactory, Type handlerType)
{
ScopeFactory = scopeFactory;
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.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Threading;
@ -28,7 +29,7 @@ namespace Volo.Abp.EventBus.Local
public LocalEventBus(
IOptions<LocalEventBusOptions> options,
IHybridServiceScopeFactory serviceScopeFactory)
IServiceScopeFactory serviceScopeFactory)
: base(serviceScopeFactory)
{
Options = options.Value;

Loading…
Cancel
Save