Skip to content

Commit 5d565a2

Browse files
committed
* XML doc for AmqpEnvironment
1 parent 45f5ca7 commit 5d565a2

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

RabbitMQ.AMQP.Client/Impl/AmqpEnvironment.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010

1111
namespace RabbitMQ.AMQP.Client.Impl
1212
{
13+
/// <summary>
14+
/// <para>
15+
/// <see cref="AmqpEnvironment"/> is the implementation of <see cref="IEnvironment"/>.
16+
/// </para>
17+
/// <para>
18+
/// The <see cref="CreateConnectionAsync()"/> method allows creating <see cref="IConnection"/> instances.
19+
/// </para>
20+
/// </summary>
1321
public class AmqpEnvironment : IEnvironment
1422
{
1523
private ConnectionSettings ConnectionSettings { get; }
@@ -23,12 +31,24 @@ private AmqpEnvironment(ConnectionSettings connectionSettings, IMetricsReporter?
2331
_metricsReporter = metricsReporter;
2432
}
2533

26-
// TODO to play nicely with IoC containers, we should not have static Create methods
34+
/// <summary>
35+
/// Create a new <see cref="IEnvironment"/> instance, using the provided <see cref="ConnectionSettings"/>
36+
/// and optional <see cref="IMetricsReporter"/>
37+
/// </summary>
38+
/// <param name="connectionSettings"></param>
39+
/// <param name="metricsReporter"></param>
40+
/// <returns><see cref="IEnvironment"/> instance.</returns>
2741
public static IEnvironment Create(ConnectionSettings connectionSettings, IMetricsReporter? metricsReporter = default)
2842
{
43+
// TODO to play nicely with IoC containers, we should not have static Create methods
2944
return new AmqpEnvironment(connectionSettings, metricsReporter);
3045
}
3146

47+
/// <summary>
48+
/// Create a new <see cref="IConnection"/> instance, using the provided <see cref="ConnectionSettings"/>.
49+
/// </summary>
50+
/// <param name="connectionSettings"></param>
51+
/// <returns><see cref="Task{IConnection}"/> instance.</returns>
3252
public async Task<IConnection> CreateConnectionAsync(ConnectionSettings connectionSettings)
3353
{
3454
IConnection c = await AmqpConnection.CreateAsync(connectionSettings, _metricsReporter).ConfigureAwait(false);
@@ -49,6 +69,10 @@ public async Task<IConnection> CreateConnectionAsync(ConnectionSettings connecti
4969
return c;
5070
}
5171

72+
/// <summary>
73+
/// Create a new <see cref="IConnection"/> instance, using the <see cref="IEnvironment"/> <see cref="ConnectionSettings"/>.
74+
/// </summary>
75+
/// <returns><see cref="Task{IConnection}"/> instance.</returns>
5276
public Task<IConnection> CreateConnectionAsync()
5377
{
5478
if (ConnectionSettings is null)
@@ -59,6 +83,10 @@ public Task<IConnection> CreateConnectionAsync()
5983
return CreateConnectionAsync(ConnectionSettings);
6084
}
6185

86+
/// <summary>
87+
/// Close this environment and its resources.
88+
/// </summary>
89+
/// <returns><see cref="Task"/></returns>
6290
// TODO cancellation token
6391
public Task CloseAsync()
6492
{

0 commit comments

Comments
 (0)