parent
2a241294b5
commit
bb7b2808e2
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace NzbDrone.Common.TPL
|
||||
{
|
||||
public interface IDebounceManager
|
||||
{
|
||||
Debouncer CreateDebouncer(Action action, TimeSpan debounceDuration);
|
||||
}
|
||||
|
||||
public class DebounceManager : IDebounceManager
|
||||
{
|
||||
public Debouncer CreateDebouncer(Action action, TimeSpan debounceDuration)
|
||||
{
|
||||
return new Debouncer(action, debounceDuration);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using NzbDrone.Common.TPL;
|
||||
|
||||
namespace NzbDrone.Test.Common
|
||||
{
|
||||
public class MockDebouncer : Debouncer
|
||||
{
|
||||
public MockDebouncer(Action action, TimeSpan debounceDuration)
|
||||
: base(action, debounceDuration)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Execute()
|
||||
{
|
||||
lock (_timer)
|
||||
{
|
||||
_action();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue