Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
archi-Doc committed Aug 21, 2024
1 parent 0237ccf commit 0671c2b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions CrossChannel/Channel/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,51 @@

namespace CrossChannel;

/// <summary>
/// Represents an abstract channel.
/// </summary>
public abstract class Channel
{
/// <summary>
/// The threshold value for trimming the channel list.
/// </summary>
public const int TrimThreshold = 32;

/// <summary>
/// The threshold value for checking weak references in the channel list.
/// </summary>
public const int CheckReferenceThreshold = 32;

/// <summary>
/// Gets the maximum number of links allowed in the channel.
/// </summary>
public int MaxLinks { get; internal set; }

/// <summary>
/// Gets or sets the index of the node in the channel.
/// </summary>
internal int NodeIndex { get; set; }

/// <summary>
/// Gets the broker object associated with the channel.
/// </summary>
/// <returns>The broker object.</returns>
internal abstract object GetBroker();
}

/// <summary>
/// Represents a channel interface for a specific service.
/// </summary>
/// <typeparam name="TService">The type of the service.</typeparam>
public interface IChannel<TService>
where TService : class, IRadioService
{
/// <summary>
/// Opens a channel for the specified service instance.
/// </summary>
/// <param name="instance">The service instance.</param>
/// <param name="weakReference">Specifies whether to use a weak reference for the service instance.</param>
/// <returns>The channel link if the channel is successfully opened; otherwise, null.</returns>
Channel<TService>.Link? Open(TService instance, bool weakReference = false);
}

Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Version>2.0.2</Version>
<Version>2.0.3</Version>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Deterministic>true</Deterministic>
Expand Down

0 comments on commit 0671c2b

Please sign in to comment.