Mark van Renswoude
f8fca5879c
- Compiles, but that's about it. Plenty of ToDo's left before it will run. Beware, ye who enter here. - Cleanup of the internals, with the aim to keep the interface to application code compatible - Added the ability to declare durable queues on startup and update the bindings - Possibly fixed an issue with publish timeouts being logged after a reconnect
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Tapeti.Config;
|
|
|
|
namespace Tapeti.Transient
|
|
{
|
|
/// <inheritdoc cref="ITapetiExtension" />
|
|
public class TransientExtension : ITapetiExtensionBinding
|
|
{
|
|
private readonly string dynamicQueuePrefix;
|
|
private readonly TransientRouter router;
|
|
|
|
|
|
/// <inheritdoc />
|
|
public TransientExtension(TimeSpan defaultTimeout, string dynamicQueuePrefix)
|
|
{
|
|
this.dynamicQueuePrefix = dynamicQueuePrefix;
|
|
router = new TransientRouter(defaultTimeout);
|
|
}
|
|
|
|
|
|
/// <inheritdoc />
|
|
public void RegisterDefaults(IDependencyContainer container)
|
|
{
|
|
container.RegisterDefaultSingleton(router);
|
|
container.RegisterDefault<ITransientPublisher, TransientPublisher>();
|
|
}
|
|
|
|
|
|
/// <inheritdoc />
|
|
public IEnumerable<object> GetMiddleware(IDependencyResolver dependencyResolver)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
|
|
/// <inheritdoc />
|
|
public IEnumerable<IBinding> GetBindings(IDependencyResolver dependencyResolver)
|
|
{
|
|
yield return new TransientGenericBinding(router, dynamicQueuePrefix);
|
|
}
|
|
}
|
|
} |