Initial commit: SWP.Core enterprise framework with multi-tenant architecture, configuration management, security, telemetry and comprehensive test suite
This commit is contained in:
commit
5275a75502
87 changed files with 6140 additions and 0 deletions
23
Core/Telemetry/MessageChannel.cs
Normal file
23
Core/Telemetry/MessageChannel.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using Microsoft.ApplicationInsights.Channel;
|
||||
using System.Threading.Channels;
|
||||
|
||||
namespace SWP.Core.Telemetry
|
||||
{
|
||||
public class MessageChannel : IMessageChannel<ITelemetry>
|
||||
{
|
||||
private readonly Channel<ITelemetry> _channel;
|
||||
|
||||
public MessageChannel()
|
||||
{
|
||||
_channel = Channel.CreateUnbounded<ITelemetry>();
|
||||
}
|
||||
|
||||
public ChannelWriter<ITelemetry> Writer => _channel.Writer;
|
||||
public ChannelReader<ITelemetry> Reader => _channel.Reader;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_channel.Writer.Complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue