Browse Source

Rename AsyncUnregister to Unregister

pull/594/head
Halil ibrahim Kalkan 8 years ago
parent
commit
06f311f023
  1. 8
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBus.cs
  2. 6
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventBus.cs
  3. 4
      framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/NullEventBus.cs
  4. 2
      framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/ActionBasedEventHandlerTest.cs

8
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/EventBus.cs

@ -33,7 +33,9 @@ namespace Volo.Abp.EventBus
protected EventBusOptions Options { get; }
public EventBus(IOptions<EventBusOptions> options, IServiceProvider serviceProvider)
public EventBus(
IOptions<EventBusOptions> options,
IServiceProvider serviceProvider)
{
Options = options.Value;
Logger = NullLogger<EventBus>.Instance;
@ -105,7 +107,7 @@ namespace Volo.Abp.EventBus
}
/// <inheritdoc/>
public void AsyncUnregister<TEvent>(Func<TEvent, Task> action) where TEvent : class
public void Unregister<TEvent>(Func<TEvent, Task> action) where TEvent : class
{
Check.NotNull(action, nameof(action));
@ -133,7 +135,7 @@ namespace Volo.Abp.EventBus
}
/// <inheritdoc/>
public void AsyncUnregister<TEvent>(IEventHandler<TEvent> handler) where TEvent : class
public void Unregister<TEvent>(IEventHandler<TEvent> handler) where TEvent : class
{
Unregister(typeof(TEvent), handler);
}

6
framework/src/Volo.Abp.EventBus/Volo/Abp/EventBus/IEventBus.cs

@ -19,7 +19,7 @@ namespace Volo.Abp.EventBus
/// <summary>
/// Registers to an event.
/// Same (given) instance of the async handler is used for all event occurrences.
/// Same (given) instance of the handler is used for all event occurrences.
/// </summary>
/// <typeparam name="TEvent">Event type</typeparam>
/// <param name="handler">Object to handle the event</param>
@ -65,7 +65,7 @@ namespace Volo.Abp.EventBus
/// </summary>
/// <typeparam name="TEvent">Event type</typeparam>
/// <param name="action"></param>
void AsyncUnregister<TEvent>(Func<TEvent, Task> action)
void Unregister<TEvent>(Func<TEvent, Task> action)
where TEvent : class;
/// <summary>
@ -73,7 +73,7 @@ namespace Volo.Abp.EventBus
/// </summary>
/// <typeparam name="TEvent">Event type</typeparam>
/// <param name="handler">Handler object that is registered before</param>
void AsyncUnregister<TEvent>(IEventHandler<TEvent> handler)
void Unregister<TEvent>(IEventHandler<TEvent> handler)
where TEvent : class;
/// <summary>

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

@ -42,12 +42,12 @@ namespace Volo.Abp.EventBus
return NullDisposable.Instance;
}
public void AsyncUnregister<TEvent>(Func<TEvent, Task> action) where TEvent : class
public void Unregister<TEvent>(Func<TEvent, Task> action) where TEvent : class
{
}
public void AsyncUnregister<TEvent>(IEventHandler<TEvent> handler) where TEvent : class
public void Unregister<TEvent>(IEventHandler<TEvent> handler) where TEvent : class
{
}

2
framework/test/Volo.Abp.EventBus.Tests/Volo/Abp/EventBus/ActionBasedEventHandlerTest.cs

@ -88,7 +88,7 @@ namespace Volo.Abp.EventBus
await EventBus.TriggerAsync(new MySimpleEventData(2));
await EventBus.TriggerAsync(new MySimpleEventData(3));
EventBus.AsyncUnregister(action);
EventBus.Unregister(action);
await EventBus.TriggerAsync(new MySimpleEventData(4));

Loading…
Cancel
Save