RingBufferPlus API:HostingExtensions
HostingExtensions
Namespace: Microsoft.Extensions.DependencyInjection
Represents the commands to add RingBufferPlus in ServiceCollection and Warmup.
public static class HostingExtensions
Inheritance Object → HostingExtensions
Methods
AddRingBuffer<T>(IServiceCollection, String, Func<IRingBuffer<T>, IServiceProvider, IRingBufferService<T>>)
Add RingBuffer in ServiceCollection.
public static IServiceCollection AddRingBuffer<T>(IServiceCollection ServiceCollection, string buffername, Func<IRingBuffer<T>, IServiceProvider, IRingBufferService<T>> userfunc)
Type Parameters
T
Type of buffer.
Parameters
ServiceCollection
IServiceCollection
The .
buffername
String
The unique name to RingBuffer.
userfunc
Func<IRingBuffer<T>, IServiceProvider, IRingBufferService<T>>
The Handler to return the IRingBufferService<T>.
Returns
.
WarmupRingBuffer<T>(IHost, String, Nullable<TimeSpan>)
Warmup RingBuffer with full capacity ready or reaching timeout .
If you do not use the ‘Warmup Ring Buffer’ command, the first access to acquire the buffer will be Warmup (not recommended)
public static bool WarmupRingBuffer<T>(IHost appbluild, string buffername, Nullable<TimeSpan> timeout)
Type Parameters
T
Type of buffer.
Parameters
appbluild
IHost
The .
buffername
String
The unique name to RingBuffer.
timeout
Nullable<TimeSpan>
The timeout for full capacity ready. Default value is 30 seconds.
Returns
True if full capacity ready, otherwise false (Timeout but keeps running).