Elastic.Channels
0.7.5
Prefix Reserved
dotnet add package Elastic.Channels --version 0.7.5
NuGet\Install-Package Elastic.Channels -Version 0.7.5
<PackageReference Include="Elastic.Channels" Version="0.7.5" />
paket add Elastic.Channels --version 0.7.5
#r "nuget: Elastic.Channels, 0.7.5"
// Install Elastic.Channels as a Cake Addin #addin nuget:?package=Elastic.Channels&version=0.7.5 // Install Elastic.Channels as a Cake Tool #tool nuget:?package=Elastic.Channels&version=0.7.5
Elastic.Channels
Provides an specialized System.Threading.Channels.ChannelWriter
implementation that makes it easy
to consume data pushed to that thread in batches.
The batches will emit either when a certain maximum is hit or when a batch's lifecycle exceeds a certain age.
This allows data of various rates to pushed in the same manner while different implementations to send the batched data to receivers can be implemented.
This package serves mainly as a core library with abstract classes and does not ship any useful implementations.
It ships with a NoopBufferedChannel
implementation that does nothing in its `ExporExport implementation for unit test and benchmark purposes.
BufferedChannelBase<>
An abstract class that requires implementers to implement:
protected abstract Task<TResponse> Export(IReadOnlyCollection<TEvent> buffer, CancellationToken ctx);
Any implementation allows data to pushed to it through:
var e = new TEvent();
if (await channel.WaitToWriteAsync(e))
written++;
ChannelOptionsBase<>
Implementers of BufferedChannelBase<>
must also create their own implementation of ChannelOptionsBase<>
. This to ensure each channel implementation creates an appropriately named options class.
Quick minimal implementation
public class Event { }
public class Response { }
public class NoopChannelOptions
: ChannelOptionsBase<Event, Response> { }
public class NoopBufferedChannel
: BufferedChannelBase<NoopChannelOptions, Event, Response>
{
public NoopBufferedChannel(NoopChannelOptions options)
: base(options) { }
protected override Task<Response> Export(IReadOnlyCollection<NoopEvent> buffer, CancellationToken ctx)
{
return Task.FromResult(new Response());
}
}
Now once we instantiate an NoopBufferedChannel
we can use it push data to it.
var e = new Event();
if (await noopChannel.WaitToWriteAsync(e))
written++;
Both NoopBufferedChannel
and a more specialized DiagnosticsBufferedChannel
exist for test or debugging purposes.
DiagnosticsBufferedChannel.ToString()
uncovers a lot of insights into the state machinery.
BufferOptions
Each ChannelOptionsBase<>
implementation takes and exposes a BufferOptions
instance. This controls the buffering behavior of BufferedChannelBase<>
.
Option | Description |
---|---|
InboundBufferMaxSize |
The maximum number of in flight instances that can be queued in memory. If this threshold is reached, events will be dropped |
OutboundBufferMaxSize |
The number of events a local buffer should reach before sending the events in a single call to Elasticsearch. |
OutboundBufferMaxLifetime |
The maximum age of buffer before its flushed |
ExportMaxConcurrency |
Controls how many concurrent Export operations may occur |
ExportMaxRetries |
The maximum number of retries over Export |
ExportBackOfPeriod |
Func that calculates an appropriate backoff time for a retry |
ExportBufferCallback |
Called once whenever a buffer is flushed, excluding retries |
WaitHandle |
Inject a waithandle that will be signalled after each flush, excluding retries. |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Buffers (>= 4.5.1)
- System.Threading.Channels (>= 8.0.0)
-
.NETStandard 2.1
- System.Threading.Channels (>= 8.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Elastic.Channels:
Package | Downloads |
---|---|
Elastic.Ingest.Transport
Provides components to build a buffer-backed channel for publishing events to distributed systems over HTTP through Elastic.Transport |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.7.5 | 44,267 | 11/25/2024 |
0.7.4 | 152 | 11/25/2024 |
0.7.3 | 3,452 | 10/3/2024 |
0.7.2 | 194,317 | 9/18/2024 |
0.7.1 | 325 | 9/16/2024 |
0.7.0 | 502,384 | 4/10/2024 |
0.6.0 | 327 | 3/28/2024 |
0.5.7 | 17,050 | 2/13/2024 |
0.5.6 | 602 | 1/22/2024 |
0.5.5 | 632,412 | 7/12/2023 |
0.5.4 | 532 | 7/10/2023 |
0.5.3 | 552 | 7/5/2023 |
0.5.2 | 539 | 6/22/2023 |
0.5.1 | 540 | 5/4/2023 |
0.5.0 | 104,127 | 4/28/2023 |
0.4.3 | 588 | 4/17/2023 |
0.4.2 | 833 | 4/5/2023 |
0.4.1 | 562 | 4/5/2023 |
0.4.0 | 573 | 4/5/2023 |
0.3.2 | 23,120 | 2/27/2023 |
0.3.1 | 1,140 | 2/20/2023 |
0.3.0 | 808 | 2/16/2023 |
0.2.2 | 940 | 1/31/2023 |
0.2.1 | 775 | 1/31/2023 |
0.2.0 | 756 | 1/31/2023 |
0.1.0 | 964 | 1/25/2023 |