From b5bd8857b5a811d2189e0d35668cd2893f878755 Mon Sep 17 00:00:00 2001 From: Mayuki Sawatari Date: Tue, 29 Jul 2025 14:53:48 +0900 Subject: [PATCH] Add XML documentation comments. --- Multicaster.sln | 3 +- .../Directory.Build.props | 9 +-- .../NatsGroupProvider.cs | 16 +++++- .../Distributed/IDistributedGroup.cs | 3 + src/Multicaster/IMulticastGroup.cs | 57 ++++++++++++++++++- src/Multicaster/IMulticastGroupProvider.cs | 10 ++++ .../InMemory/DynamicInMemoryProxyFactory.cs | 7 ++- .../InMemory/InMemoryGroupProvider.cs | 6 +- src/Multicaster/InMemory/InMemoryProxyBase.cs | 4 +- .../InMemory/InMemoryProxyFactory.cs | 9 ++- .../Remoting/DynamicRemoteProxyFactory.cs | 7 +++ .../IRemoteClientResultPendingTaskRegistry.cs | 28 ++++++++- src/Multicaster/Remoting/IRemoteProxy.cs | 12 +++- .../Remoting/IRemoteReceiverWriter.cs | 12 +++- src/Multicaster/Remoting/IRemoteSerializer.cs | 4 +- .../Remoting/IRemoteSingleWriter.cs | 3 + ...edRemoteClientResultPendingTaskRegistry.cs | 10 +++- src/Multicaster/Remoting/PendingMessage.cs | 8 ++- .../Remoting/RemoteGroupProvider.cs | 6 +- .../Remoting/RemoteOnlyGroupProvider.cs | 6 +- .../Remoting/RemoteProxyBase.Invoke.cs | 4 +- src/Multicaster/Remoting/RemoteProxyBase.cs | 7 ++- .../Remoting/RemoteProxyFactory.cs | 10 +++- 23 files changed, 212 insertions(+), 29 deletions(-) rename Directory.Build.props => src/Directory.Build.props (79%) diff --git a/Multicaster.sln b/Multicaster.sln index c24055d..3e552b1 100644 --- a/Multicaster.sln +++ b/Multicaster.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.10.34916.146 @@ -9,7 +8,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Multicaster.Tests", "test\M EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7ED9EEF8-6BF3-4F69-BD7E-D1B25905BD30}" ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props + src\Directory.Build.props = src\Directory.Build.props Directory.Packages.props = Directory.Packages.props README.md = README.md EndProjectSection diff --git a/Directory.Build.props b/src/Directory.Build.props similarity index 79% rename from Directory.Build.props rename to src/Directory.Build.props index c637141..e193f0c 100644 --- a/Directory.Build.props +++ b/src/Directory.Build.props @@ -7,7 +7,7 @@ 12 true - $(MSBuildThisFileDirectory)\src\Multicaster\opensource.snk + $(MSBuildThisFileDirectory)\Multicaster\opensource.snk @@ -30,12 +30,13 @@ README.md true snupkg + true true - - + + - \ No newline at end of file + diff --git a/src/Multicaster.Distributed.Nats/NatsGroupProvider.cs b/src/Multicaster.Distributed.Nats/NatsGroupProvider.cs index dbaf34f..031c425 100644 --- a/src/Multicaster.Distributed.Nats/NatsGroupProvider.cs +++ b/src/Multicaster.Distributed.Nats/NatsGroupProvider.cs @@ -10,6 +10,9 @@ namespace Cysharp.Runtime.Multicast.Distributed.Nats; +/// +/// Provides functionality for managing multicast groups over a NATS (NATS.io) connection. +/// public class NatsGroupProvider : IMulticastGroupProvider { private readonly ConcurrentDictionary<(string Name, Type KeyType, Type ReceiverType), object> _groups = new(); @@ -18,10 +21,16 @@ public class NatsGroupProvider : IMulticastGroupProvider private readonly IRemoteSerializer _serializer; private readonly MessagePackSerializerOptions _messagePackSerializerOptionsForKey; + /// + /// Initializes a new instance of the class with the specified proxy factory, serializer, and configuration options. + /// public NatsGroupProvider(IRemoteProxyFactory proxyFactory, IRemoteSerializer serializer, IOptions options) : this(proxyFactory, serializer, options.Value) {} + /// + /// Initializes a new instance of the class, which provides functionality for managing groups using NATS messaging. + /// public NatsGroupProvider(IRemoteProxyFactory proxyFactory, IRemoteSerializer serializer, NatsGroupOptions options) { _connection = new NatsConnection(NatsOpts.Default with { Url = options.Url }); @@ -34,10 +43,12 @@ public NatsGroupProvider(IRemoteProxyFactory proxyFactory, IRemoteSerializer ser ); } + /// public IMulticastAsyncGroup GetOrAddGroup(string name) where TKey : IEquatable => (IMulticastAsyncGroup)_groups.GetOrAdd((name, typeof(TKey), typeof(TReceiver)), _ => new NatsGroup(name, _connection, _proxyFactory, _serializer, _messagePackSerializerOptionsForKey, Remove)); + /// public IMulticastSyncGroup GetOrAddSynchronousGroup(string name) where TKey : IEquatable => (IMulticastSyncGroup)_groups.GetOrAdd((name, typeof(TKey), typeof(TReceiver)), _ => new NatsGroup(name, _connection, _proxyFactory, _serializer, _messagePackSerializerOptionsForKey, Remove)); @@ -49,6 +60,9 @@ private void Remove(NatsGroup group) } } +/// +/// Represents configuration options for a NATS group, including server connection details and serialization settings. +/// public class NatsGroupOptions { /// @@ -60,4 +74,4 @@ public class NatsGroupOptions /// Gets or sets a MessagePackSerializerOptions used for serializing the key. /// public MessagePackSerializerOptions MessagePackSerializerOptionsForKey { get; set; } = MessagePackSerializer.DefaultOptions; -} \ No newline at end of file +} diff --git a/src/Multicaster/Distributed/IDistributedGroup.cs b/src/Multicaster/Distributed/IDistributedGroup.cs index c619c3c..21c6f6a 100644 --- a/src/Multicaster/Distributed/IDistributedGroup.cs +++ b/src/Multicaster/Distributed/IDistributedGroup.cs @@ -1,3 +1,6 @@ namespace Cysharp.Runtime.Multicast.Distributed; +/// +/// Represents a marker interface for a group that utilizes a distributed backplane. +/// public interface IDistributedGroup; diff --git a/src/Multicaster/IMulticastGroup.cs b/src/Multicaster/IMulticastGroup.cs index 460cbd4..30817f4 100644 --- a/src/Multicaster/IMulticastGroup.cs +++ b/src/Multicaster/IMulticastGroup.cs @@ -1,33 +1,88 @@ namespace Cysharp.Runtime.Multicast; +/// +/// Represents a multicast group that allows sending messages to multiple receivers based on specified inclusion or +/// exclusion criteria. +/// +/// The type of the key used to identify receivers. Must implement . +/// The type of the receiver that messages are sent to. public interface IMulticastGroup where TKey : IEquatable { + /// + /// Gets a receiver that processes all messages without filtering. + /// TReceiver All { get; } + + /// + /// Returns a new instance of the receiver with elements excluded based on the specified keys. + /// TReceiver Except(IEnumerable excludes); + + /// + /// Filters the current set of targets to include only the specified ones. + /// TReceiver Only(IEnumerable targets); + + /// + /// Retrieves a single instance of associated with the specified . + /// TReceiver Single(TKey target); } +/// +/// Represents a multicast group that supports asynchronous operations for managing receivers. +/// public interface IMulticastAsyncGroup : IMulticastGroup, IDisposable where TKey : IEquatable { + /// + /// Adds a key and its associated receiver to the group asynchronously. + /// ValueTask AddAsync(TKey key, TReceiver receiver, CancellationToken cancellationToken = default); + + /// + /// Removes the item associated with the specified key from the group asynchronously. + /// ValueTask RemoveAsync(TKey key, CancellationToken cancellationToken = default); + + /// + /// Counts the total number of items in the group asynchronously. + /// ValueTask CountAsync(CancellationToken cancellationToken = default); } +/// +/// Represents a multicast group that supports synchronous operations for managing receivers. +/// public interface IMulticastSyncGroup : IMulticastGroup, IDisposable where TKey : IEquatable { + /// + /// Adds a key and its associated receiver to the group. + /// void Add(TKey key, TReceiver receiver); + + /// + /// Removes the item associated with the specified key from the group. + /// void Remove(TKey key); + + /// + /// Counts the total number of items in the group. + /// int Count(); } +/// +/// Provides extension methods for working with multicast groups. +/// public static class MulticastGroupExtensions { + /// + /// Returns a new instance of the receiver with elements excluded based on the specified key. + /// public static TReceiver Except(this IMulticastGroup group, TKey exclude) where TKey : IEquatable => group.Except([exclude]); -} \ No newline at end of file +} diff --git a/src/Multicaster/IMulticastGroupProvider.cs b/src/Multicaster/IMulticastGroupProvider.cs index 4bfa012..6a8a224 100644 --- a/src/Multicaster/IMulticastGroupProvider.cs +++ b/src/Multicaster/IMulticastGroupProvider.cs @@ -1,9 +1,19 @@ namespace Cysharp.Runtime.Multicast; +/// +/// Provides functionality to manage and retrieve multicast groups, supporting both asynchronous and synchronous communication patterns. +/// public interface IMulticastGroupProvider { + /// + /// Retrieves an existing multicast group by name or creates a new one if it does not exist. + /// IMulticastAsyncGroup GetOrAddGroup(string name) where TKey : IEquatable; + + /// + /// Retrieves an existing synchronous multicast group by name or creates a new one if it does not exist. + /// IMulticastSyncGroup GetOrAddSynchronousGroup(string name) where TKey : IEquatable; } diff --git a/src/Multicaster/InMemory/DynamicInMemoryProxyFactory.cs b/src/Multicaster/InMemory/DynamicInMemoryProxyFactory.cs index bd803eb..144a877 100644 --- a/src/Multicaster/InMemory/DynamicInMemoryProxyFactory.cs +++ b/src/Multicaster/InMemory/DynamicInMemoryProxyFactory.cs @@ -2,8 +2,13 @@ using System.Reflection; using System.Reflection.Emit; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + namespace Cysharp.Runtime.Multicast.InMemory; +/// +/// Provides a factory for dynamically creating in-memory proxy instances for a specified interface type. +/// public class DynamicInMemoryProxyFactory : IInMemoryProxyFactory { public static IInMemoryProxyFactory Instance { get; } = new DynamicInMemoryProxyFactory(); @@ -227,4 +232,4 @@ static Core() public static T Create(IReceiverHolder receivers, ImmutableArray excludes, ImmutableArray? targets) => _factory(receivers, excludes, targets); } -} \ No newline at end of file +} diff --git a/src/Multicaster/InMemory/InMemoryGroupProvider.cs b/src/Multicaster/InMemory/InMemoryGroupProvider.cs index e390a61..712224a 100644 --- a/src/Multicaster/InMemory/InMemoryGroupProvider.cs +++ b/src/Multicaster/InMemory/InMemoryGroupProvider.cs @@ -1,6 +1,8 @@ using System.Collections.Concurrent; using System.Collections.Immutable; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + namespace Cysharp.Runtime.Multicast.InMemory; public class InMemoryGroupProvider : IMulticastGroupProvider @@ -13,10 +15,12 @@ public InMemoryGroupProvider(IInMemoryProxyFactory proxyFactory) _proxyFactory = proxyFactory; } + /// public IMulticastAsyncGroup GetOrAddGroup(string name) where TKey : IEquatable => (IMulticastAsyncGroup)_groups.GetOrAdd((typeof(TKey), typeof(T), name), _ => new InMemoryGroup(name, _proxyFactory, Remove)); + /// public IMulticastSyncGroup GetOrAddSynchronousGroup(string name) where TKey : IEquatable => (IMulticastSyncGroup)_groups.GetOrAdd((typeof(TKey), typeof(T), name), _ => new InMemoryGroup(name, _proxyFactory, Remove)); @@ -108,4 +112,4 @@ private void ThrowIfDisposed() { if (_disposed) throw new ObjectDisposedException(nameof(InMemoryGroup)); } -} \ No newline at end of file +} diff --git a/src/Multicaster/InMemory/InMemoryProxyBase.cs b/src/Multicaster/InMemory/InMemoryProxyBase.cs index 3b771d4..8e7e6d3 100644 --- a/src/Multicaster/InMemory/InMemoryProxyBase.cs +++ b/src/Multicaster/InMemory/InMemoryProxyBase.cs @@ -4,6 +4,8 @@ namespace Cysharp.Runtime.Multicast.InMemory; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + public abstract class InMemoryProxyBase where TKey : IEquatable { @@ -566,4 +568,4 @@ private void ThrowIfNotSingle() [MethodImpl(MethodImplOptions.AggressiveInlining)] private bool CanInvoke(ReceiverRegistration r) => !r.HasKey || r.Key is null || (!_excludes.Contains(r.Key) && (_targets is null || _targets.Value.Contains(r.Key))); -} \ No newline at end of file +} diff --git a/src/Multicaster/InMemory/InMemoryProxyFactory.cs b/src/Multicaster/InMemory/InMemoryProxyFactory.cs index 08cf7f8..9ac4382 100644 --- a/src/Multicaster/InMemory/InMemoryProxyFactory.cs +++ b/src/Multicaster/InMemory/InMemoryProxyFactory.cs @@ -1,9 +1,8 @@ -using System; -using System.Collections; -using System.Collections.Concurrent; -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Runtime.InteropServices; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + namespace Cysharp.Runtime.Multicast.InMemory; public interface IInMemoryProxyFactory @@ -153,4 +152,4 @@ public void Dispose() { _onDispose(_state); } -} \ No newline at end of file +} diff --git a/src/Multicaster/Remoting/DynamicRemoteProxyFactory.cs b/src/Multicaster/Remoting/DynamicRemoteProxyFactory.cs index 9b1bd31..20cf30c 100644 --- a/src/Multicaster/Remoting/DynamicRemoteProxyFactory.cs +++ b/src/Multicaster/Remoting/DynamicRemoteProxyFactory.cs @@ -4,8 +4,14 @@ namespace Cysharp.Runtime.Multicast.Remoting; +/// +/// Provides a factory for dynamically creating remote proxy instances that implement a specified interface. +/// public class DynamicRemoteProxyFactory : IRemoteProxyFactory { + /// + /// Gets the singleton instance of the remote proxy factory. + /// public static IRemoteProxyFactory Instance { get; } = new DynamicRemoteProxyFactory(); private static readonly AssemblyBuilder _assemblyBuilder; @@ -17,6 +23,7 @@ static DynamicRemoteProxyFactory() _moduleBuilder = _assemblyBuilder.DefineDynamicModule("Multicaster"); } + /// public T Create(IRemoteReceiverWriter writer, IRemoteSerializer serializer) { return Core.Create(writer, serializer); diff --git a/src/Multicaster/Remoting/IRemoteClientResultPendingTaskRegistry.cs b/src/Multicaster/Remoting/IRemoteClientResultPendingTaskRegistry.cs index 053ed0f..363dee7 100644 --- a/src/Multicaster/Remoting/IRemoteClientResultPendingTaskRegistry.cs +++ b/src/Multicaster/Remoting/IRemoteClientResultPendingTaskRegistry.cs @@ -1,16 +1,37 @@ using System.Collections.Concurrent; using System.Diagnostics.CodeAnalysis; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + namespace Cysharp.Runtime.Multicast.Remoting; +/// +/// Provides a registry for managing pending tasks associated with remote client operations. +/// public interface IRemoteClientResultPendingTaskRegistry : IDisposable { + /// + /// Registers a pending task to be processed. + /// void Register(PendingTask pendingTask); + + /// + /// Attempts to retrieve and unregister a pending task associated with the specified message ID. + /// bool TryGetAndUnregisterPendingTask(Guid messageId, [NotNullWhen(true)] out PendingTask? pendingTask); + + /// + /// Creates a pending task that represents an asynchronous operation to be completed later. + /// PendingTask CreateTask(string methodName, int methodId, Guid messageId, TaskCompletionSource taskCompletionSource, CancellationToken timeoutCancellationToken, IRemoteSerializer serializer); + + /// + /// Creates a pending task that represents an asynchronous operation to be completed later. + /// PendingTask CreateTask(string methodName, int methodId, Guid messageId, TaskCompletionSource taskCompletionSource, CancellationToken timeoutCancellationToken, IRemoteSerializer serializer); } +/// public class RemoteClientResultPendingTaskRegistry : IRemoteClientResultPendingTaskRegistry { private readonly ConcurrentDictionary _pendingTasks = new(); @@ -26,9 +47,11 @@ public RemoteClientResultPendingTaskRegistry(TimeSpan? timeout = default, TimePr _timeProvider = timeProvider ?? TimeProvider.System; } + /// public PendingTask CreateTask(string methodName, int methodId, Guid messageId, TaskCompletionSource taskCompletionSource, CancellationToken timeoutCancellationToken, IRemoteSerializer serializer) => PendingTask.Create(methodName, methodId, messageId, taskCompletionSource, CreateTimeoutCancellationToken(timeoutCancellationToken), serializer); + /// public PendingTask CreateTask(string methodName, int methodId, Guid messageId, TaskCompletionSource taskCompletionSource, CancellationToken timeoutCancellationToken, IRemoteSerializer serializer) => PendingTask.Create(methodName, methodId, messageId, taskCompletionSource, CreateTimeoutCancellationToken(timeoutCancellationToken), serializer); @@ -43,6 +66,7 @@ private CancellationToken CreateTimeoutCancellationToken(CancellationToken timeo #endif } + /// public void Register(PendingTask pendingTask) { if (_disposed) @@ -59,6 +83,7 @@ public void Register(PendingTask pendingTask) _pendingTasks[pendingTask.MessageId] = (pendingTask, registration); } + /// public bool TryGetAndUnregisterPendingTask(Guid messageId, [NotNullWhen(true)] out PendingTask? pendingTask) { var removed = _pendingTasks.TryRemove(messageId, out var taskAndCancelRegistration); @@ -74,6 +99,7 @@ public bool TryGetAndUnregisterPendingTask(Guid messageId, [NotNullWhen(true)] o return removed; } + /// public void Dispose() { _disposed = true; @@ -93,4 +119,4 @@ public void Dispose() goto DisposeAll; } } -} \ No newline at end of file +} diff --git a/src/Multicaster/Remoting/IRemoteProxy.cs b/src/Multicaster/Remoting/IRemoteProxy.cs index 44567ae..c4c0157 100644 --- a/src/Multicaster/Remoting/IRemoteProxy.cs +++ b/src/Multicaster/Remoting/IRemoteProxy.cs @@ -2,7 +2,17 @@ namespace Cysharp.Runtime.Multicast.Remoting; +/// +/// Represents a proxy for interacting with a remote receiver, providing methods to access its writer. +/// public interface IRemoteProxy { + /// + /// Attempts to retrieve a direct writer for remote receiver communication. + /// + /// + /// This method returns a direct writer if the remote proxy holds or implements a direct writer for the remote receiver. + /// If the proxy is grouped or does not have a direct writer, it will return false. + /// bool TryGetDirectWriter([NotNullWhen(true)] out IRemoteReceiverWriter? receiver); -} \ No newline at end of file +} diff --git a/src/Multicaster/Remoting/IRemoteReceiverWriter.cs b/src/Multicaster/Remoting/IRemoteReceiverWriter.cs index 4376ea8..b35a477 100644 --- a/src/Multicaster/Remoting/IRemoteReceiverWriter.cs +++ b/src/Multicaster/Remoting/IRemoteReceiverWriter.cs @@ -1,7 +1,17 @@ namespace Cysharp.Runtime.Multicast.Remoting; +/// +/// Defines functionality for writing data to a remote receiver and managing pending tasks. +/// public interface IRemoteReceiverWriter { + /// + /// Writes the specified payload to the underlying receiver target. + /// void Write(ReadOnlyMemory payload); + + /// + /// Gets the registry of pending tasks associated with the remote client. + /// IRemoteClientResultPendingTaskRegistry PendingTasks { get; } -} \ No newline at end of file +} diff --git a/src/Multicaster/Remoting/IRemoteSerializer.cs b/src/Multicaster/Remoting/IRemoteSerializer.cs index d2b91be..58cbee1 100644 --- a/src/Multicaster/Remoting/IRemoteSerializer.cs +++ b/src/Multicaster/Remoting/IRemoteSerializer.cs @@ -2,6 +2,8 @@ namespace Cysharp.Runtime.Multicast.Remoting; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + public interface IRemoteSerializer { void SerializeInvocation(IBufferWriter writer, in SerializationContext ctx); @@ -24,4 +26,4 @@ public interface IRemoteSerializer T? DeserializeResult(ReadOnlySequence data, in SerializationContext ctx); } -public readonly record struct SerializationContext(string MethodName, int MethodId, Guid? MessageId); \ No newline at end of file +public readonly record struct SerializationContext(string MethodName, int MethodId, Guid? MessageId); diff --git a/src/Multicaster/Remoting/IRemoteSingleWriter.cs b/src/Multicaster/Remoting/IRemoteSingleWriter.cs index e90a0e8..e9a5249 100644 --- a/src/Multicaster/Remoting/IRemoteSingleWriter.cs +++ b/src/Multicaster/Remoting/IRemoteSingleWriter.cs @@ -1,3 +1,6 @@ namespace Cysharp.Runtime.Multicast.Remoting; +/// +/// Represents an interface for writing to a single remote target. +/// public interface IRemoteSingleWriter; diff --git a/src/Multicaster/Remoting/NotSupportedRemoteClientResultPendingTaskRegistry.cs b/src/Multicaster/Remoting/NotSupportedRemoteClientResultPendingTaskRegistry.cs index 14d7c30..0d52a36 100644 --- a/src/Multicaster/Remoting/NotSupportedRemoteClientResultPendingTaskRegistry.cs +++ b/src/Multicaster/Remoting/NotSupportedRemoteClientResultPendingTaskRegistry.cs @@ -1,9 +1,17 @@ using System.Diagnostics.CodeAnalysis; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + namespace Cysharp.Runtime.Multicast.Remoting; +/// +/// Represents a registry for managing pending tasks related to remote client results that is not supported. +/// public class NotSupportedRemoteClientResultPendingTaskRegistry : IRemoteClientResultPendingTaskRegistry { + /// + /// Gets the singleton instance of the implementation. + /// public static IRemoteClientResultPendingTaskRegistry Instance { get; } = new NotSupportedRemoteClientResultPendingTaskRegistry(); public void Register(PendingTask pendingTask) @@ -21,4 +29,4 @@ public PendingTask CreateTask(string methodName, int methodId, Guid messageId, T public void Dispose() { } -} \ No newline at end of file +} diff --git a/src/Multicaster/Remoting/PendingMessage.cs b/src/Multicaster/Remoting/PendingMessage.cs index 80b66aa..5d17026 100644 --- a/src/Multicaster/Remoting/PendingMessage.cs +++ b/src/Multicaster/Remoting/PendingMessage.cs @@ -1,7 +1,13 @@ using System.Buffers; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + namespace Cysharp.Runtime.Multicast.Remoting; +/// +/// Represents a task that is pending completion, typically used for managing asynchronous operations in a remote +/// communication context. +/// public class PendingTask { private readonly Func, bool> _trySetResult; @@ -76,4 +82,4 @@ public static readonly Func TrySetException public static readonly Func TrySetCanceled = static (message, ct) => ((TaskCompletionSource)message.TaskCompletionSource).TrySetCanceled(ct); } -}; \ No newline at end of file +}; diff --git a/src/Multicaster/Remoting/RemoteGroupProvider.cs b/src/Multicaster/Remoting/RemoteGroupProvider.cs index 611504a..7b7bee6 100644 --- a/src/Multicaster/Remoting/RemoteGroupProvider.cs +++ b/src/Multicaster/Remoting/RemoteGroupProvider.cs @@ -2,6 +2,8 @@ using System.Collections.Immutable; using Cysharp.Runtime.Multicast.InMemory; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + namespace Cysharp.Runtime.Multicast.Remoting; public class RemoteGroupProvider : IMulticastGroupProvider @@ -18,10 +20,12 @@ public RemoteGroupProvider(IInMemoryProxyFactory proxyFactory, IRemoteProxyFacto _remoteSerializer = remoteSerializer; } + /// public IMulticastAsyncGroup GetOrAddGroup(string name) where TKey : IEquatable => (IMulticastAsyncGroup)_groups.GetOrAdd((typeof(TKey), typeof(T), name), _ => new RemoteCompositeGroup(name, _proxyFactory, _remoteProxyFactory, _remoteSerializer, Remove)); + /// public IMulticastSyncGroup GetOrAddSynchronousGroup(string name) where TKey : IEquatable => (IMulticastSyncGroup)_groups.GetOrAdd((typeof(TKey), typeof(T), name), _ => new RemoteCompositeGroup(name, _proxyFactory, _remoteProxyFactory, _remoteSerializer, Remove)); @@ -138,4 +142,4 @@ private void ThrowIfDisposed() { if (_disposed) throw new ObjectDisposedException(nameof(RemoteCompositeGroup)); } -} \ No newline at end of file +} diff --git a/src/Multicaster/Remoting/RemoteOnlyGroupProvider.cs b/src/Multicaster/Remoting/RemoteOnlyGroupProvider.cs index 129cfe7..f0fd14a 100644 --- a/src/Multicaster/Remoting/RemoteOnlyGroupProvider.cs +++ b/src/Multicaster/Remoting/RemoteOnlyGroupProvider.cs @@ -1,5 +1,7 @@ using System.Collections.Concurrent; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + namespace Cysharp.Runtime.Multicast.Remoting; public class RemoteOnlyGroupProvider : IMulticastGroupProvider @@ -16,10 +18,12 @@ public RemoteOnlyGroupProvider(IRemoteProxyFactory proxyFactory, IRemoteSerializ _pendingTasks = pendingTasks; } + /// public IMulticastAsyncGroup GetOrAddGroup(string name) where TKey : IEquatable => (IMulticastAsyncGroup)_groups.GetOrAdd((typeof(T), name), _ => new RemoteGroup(name, _proxyFactory, _serializer, Remove)); + /// public IMulticastSyncGroup GetOrAddSynchronousGroup(string name) where TKey : IEquatable => (IMulticastSyncGroup)_groups.GetOrAdd((typeof(T), name), _ => new RemoteGroup(name, _proxyFactory, _serializer, Remove)); @@ -27,4 +31,4 @@ public IMulticastSyncGroup GetOrAddSynchronousGroup(string nam private void Remove(RemoteGroup group) where TKey : IEquatable => _groups.Remove((typeof(T), group.Name), out _); -} \ No newline at end of file +} diff --git a/src/Multicaster/Remoting/RemoteProxyBase.Invoke.cs b/src/Multicaster/Remoting/RemoteProxyBase.Invoke.cs index eea6584..4e578cf 100644 --- a/src/Multicaster/Remoting/RemoteProxyBase.Invoke.cs +++ b/src/Multicaster/Remoting/RemoteProxyBase.Invoke.cs @@ -3,6 +3,8 @@ namespace Cysharp.Runtime.Multicast.Remoting; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + public partial class RemoteProxyBase { protected void Invoke(string name, int methodId, T1 arg1) @@ -367,4 +369,4 @@ protected Task InvokeWithResult payload) } } } -} \ No newline at end of file +} diff --git a/src/Multicaster/Remoting/RemoteProxyFactory.cs b/src/Multicaster/Remoting/RemoteProxyFactory.cs index be8188b..29045b5 100644 --- a/src/Multicaster/Remoting/RemoteProxyFactory.cs +++ b/src/Multicaster/Remoting/RemoteProxyFactory.cs @@ -1,10 +1,18 @@ using System.Collections.Concurrent; using System.Collections.Immutable; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + namespace Cysharp.Runtime.Multicast.Remoting; +/// +/// Defines a factory for creating remote proxy instances that communicate with a remote receiver. +/// public interface IRemoteProxyFactory { + /// + /// Creates an instance of the specified type using the provided remote receiver and serializer. + /// T Create(IRemoteReceiverWriter receiver, IRemoteSerializer serializer); } @@ -28,4 +36,4 @@ public static T Only(this IRemoteProxyFactory factory, ConcurrentDictio public static T Single(this IRemoteProxyFactory factory, ConcurrentDictionary receivers, TKey target, IRemoteSerializer serializer) where TKey : IEquatable => factory.Create(new RemoteProxyBase.RemoteSingleWriter(receivers, target), serializer); -} \ No newline at end of file +}