Skip to content

Commit

Permalink
documentation [skip ci]
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
  • Loading branch information
Gsantomaggio committed Jan 23, 2024
1 parent e26dbae commit b946c81
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
6 changes: 6 additions & 0 deletions RabbitMQ.Stream.Client/AbstractEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public abstract record EntityCommonConfig
internal ConnectionsPool Pool { get; set; }
public Func<MetaDataUpdate, Task> MetadataHandler { get; set; }

/// <summary>
/// The Identifier does not have any effect on the server.
/// It is used to identify the entity in the logs and on the UI (only for the consumer)
/// It is possible to retrieve the entity info using the Info.Identifier method form the
/// raw* instances.
/// </summary>
public string Identifier { get; set; }
}

Expand Down
1 change: 0 additions & 1 deletion RabbitMQ.Stream.Client/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ RabbitMQ.Stream.Client.Reliable.ProducerConfig.Filter.set -> void
RabbitMQ.Stream.Client.Reliable.ProducerConfig.Reference.set -> void
RabbitMQ.Stream.Client.Reliable.ProducerFactory.CreateProducer(bool boot) -> System.Threading.Tasks.Task<RabbitMQ.Stream.Client.IProducer>
RabbitMQ.Stream.Client.Reliable.ProducerFactory._producer -> RabbitMQ.Stream.Client.IProducer
RabbitMQ.Stream.Client.Reliable.ReliableBase.CompareStatus(RabbitMQ.Stream.Client.Reliable.ReliableEntityStatus toTest) -> bool
RabbitMQ.Stream.Client.Reliable.ReliableBase.UpdateStatus(RabbitMQ.Stream.Client.Reliable.ReliableEntityStatus status) -> void
RabbitMQ.Stream.Client.Reliable.ReliableBase._status -> RabbitMQ.Stream.Client.Reliable.ReliableEntityStatus
RabbitMQ.Stream.Client.Reliable.ReliableConfig.Identifier.get -> string
Expand Down
29 changes: 24 additions & 5 deletions RabbitMQ.Stream.Client/Reliable/ReliableBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,25 @@ namespace RabbitMQ.Stream.Client.Reliable;

public record ReliableConfig
{
/// <summary>
/// The interface to reconnect the entity to the server.
/// By default it uses a BackOff pattern. See <see cref="BackOffReconnectStrategy"/>
/// </summary>
public IReconnectStrategy ReconnectStrategy { get; set; }

/// <summary>
/// The interface to check if the resource is available.
/// A stream could be not fully ready during the restarting.
/// By default it uses a BackOff pattern. See <see cref="ResourceAvailableBackOffReconnectStrategy"/>
/// </summary>
public IReconnectStrategy ResourceAvailableReconnectStrategy { get; set; }

/// <summary>
/// The Identifier does not have any effect on the server.
/// It is used to identify the entity in the logs and on the UI (only for the consumer)
/// It is possible to retrieve the entity info using the Info.Identifier method form the
/// Producer/Consumer instances.
/// </summary>
public string Identifier { get; set; }

public StreamSystem StreamSystem { get; }
Expand All @@ -33,12 +49,15 @@ protected ReliableConfig(StreamSystem streamSystem, string stream)
}
}

/// <summary>
/// The ReliableEntityStatus is used to check the status of the ReliableEntity.
/// </summary>
public enum ReliableEntityStatus
{
Initialization,
Open,
Reconnecting,
Closed,
Initialization,// the entity is initializing
Open, // the entity is open and ready to use
Reconnecting,// the entity is reconnecting but still can be used
Closed,// the entity is closed and cannot be used anymore
}

/// <summary>
Expand All @@ -64,7 +83,7 @@ protected void UpdateStatus(ReliableEntityStatus status)
}
}

protected bool CompareStatus(ReliableEntityStatus toTest)
private bool CompareStatus(ReliableEntityStatus toTest)
{
lock (_lock)
{
Expand Down

0 comments on commit b946c81

Please sign in to comment.