Skip to content

Commit

Permalink
Create XML documentation file for packing with NuGet
Browse files Browse the repository at this point in the history
* Closes OrleansContrib#30
* Adds missing XML comments that were showing up as warnings upon build
  • Loading branch information
Kritner committed Dec 22, 2021
1 parent dc35067 commit c0169bd
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
13 changes: 13 additions & 0 deletions src/Orleans.SyncWork/Exceptions/InvalidStateException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,24 @@ namespace Orleans.SyncWork.Exceptions;
/// </summary>
public class InvalidStateException : Exception
{
/// <summary>
/// Construct the exception with a specific message.
/// </summary>
/// <param name="message">The message that describes the invalid state.</param>
public InvalidStateException(string message) : base(message) { }

/// <summary>
/// Construct the exception specifying the unexpectedStatus that was encountered.
/// </summary>
/// <param name="unexpectedStatus">The unexpected <see cref="SyncWorkStatus"/> that was encountered.</param>
public InvalidStateException(SyncWorkStatus unexpectedStatus) : base(
$"Grain was in an invalid state of {unexpectedStatus}.") { }

/// <summary>
/// Construct the exception that states an expected status, when the actual status was encountered.
/// </summary>
/// <param name="actualStatus">The actual <see cref="SyncWorkStatus"/> that occurred.</param>
/// <param name="expectedStatus">The expected <see cref="SyncWorkStatus"/> state that should have been received.</param>
public InvalidStateException(SyncWorkStatus actualStatus, SyncWorkStatus expectedStatus) : base(
$"Grain was in an invalid state for the requested grain method. Expected status {expectedStatus}, got {actualStatus}.") { }
}
6 changes: 3 additions & 3 deletions src/Orleans.SyncWork/ISyncWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace Orleans.SyncWork;
public interface ISyncWorker<in TRequest, TResult> : IGrainWithGuidKey
{
/// <summary>
/// Start long running work with the provided <see cref="TRequest"/>.
/// Start long running work with the provided parameter.
/// </summary>
/// <param name="request">The <see cref="TRequest"/> workload to start.</param>
/// <param name="request">The parameter containing all necessary information to start the workload.</param>
/// <returns>true if work is started, false if it was already started.</returns>
Task<bool> Start(TRequest request);
/// <summary>
Expand All @@ -25,7 +25,7 @@ public interface ISyncWorker<in TRequest, TResult> : IGrainWithGuidKey
/// <summary>
/// The result of the long running work.
/// </summary>
/// <returns>The <see cref="TResult"/></returns>
/// <returns>The result of the work done through the SyncWorker.</returns>
Task<TResult> GetResult();
/// <summary>
/// Gets the exception information when the long running work faulted.
Expand Down
1 change: 1 addition & 0 deletions src/Orleans.SyncWork/Orleans.SyncWork.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>10</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
Expand Down
8 changes: 8 additions & 0 deletions src/Orleans.SyncWork/SyncWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace Orleans.SyncWork;
/// <typeparam name="TResult">The result/response for a long running piece of work.</typeparam>
public abstract class SyncWorker<TRequest, TResult> : Grain, ISyncWorker<TRequest, TResult>
{
/// <summary>
/// The logger for the instance.
/// </summary>
protected readonly ILogger _logger;
private readonly LimitedConcurrencyLevelTaskScheduler _limitedConcurrencyScheduler;

Expand All @@ -25,6 +28,11 @@ public abstract class SyncWorker<TRequest, TResult> : Grain, ISyncWorker<TReques
private Exception _exception;
private Task _task;

/// <summary>
/// Constructs an instance of the <see cref="SyncWorker{TRequest,TResult}"/>.
/// </summary>
/// <param name="logger">The logger for the instance</param>
/// <param name="limitedConcurrencyScheduler">The task scheduler that will be used for the long running work.</param>
protected SyncWorker(ILogger logger, LimitedConcurrencyLevelTaskScheduler limitedConcurrencyScheduler)
{
_logger = logger;
Expand Down
2 changes: 1 addition & 1 deletion src/Orleans.SyncWork/SyncWorkerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static Task<TResult> StartWorkAndPollUntilResult<TRequest, TResult>(this
/// Starts the work of a <see cref="ISyncWorker{TRequest, TResult}"/>, polls it until a result is available, then returns it.
/// </summary>
/// <remarks>
/// Caution is advised when setting the <see cref="msDelayPerStatusPoll"/> "too low" - 1000 ms seems to be pretty safe,
/// Caution is advised when setting the msDelayPerStatusPoll "too low" - 1000 ms seems to be pretty safe,
/// but if the cluster is under *enough* load, that much grain polling could overwhelm it.
/// </remarks>
/// <typeparam name="TRequest">The type of request being dispatched.</typeparam>
Expand Down

0 comments on commit c0169bd

Please sign in to comment.