Implement per-school save functionality by introducing a dedicated save directory and updating the school management system to support loading and saving school states. Revise documentation to reflect these changes, including updates to the architecture and design documents, and enhance the API for reloading schools from disk. Update tests to ensure proper functionality of the new save and reload features.
This commit is contained in:
@@ -5,11 +5,11 @@ namespace HSchool.Server.Api;
|
||||
|
||||
/// <summary>
|
||||
/// The main menu talks to these: list, create, delete. Everything that mutates state is handed to
|
||||
/// the loop thread as a command and awaited, so schools stay single-threaded.
|
||||
/// the supervisor as a command and awaited, so each school stays on its own worker thread.
|
||||
/// </summary>
|
||||
internal static class SchoolEndpoints
|
||||
{
|
||||
/// <summary>How long a request waits for the loop thread before giving up.</summary>
|
||||
/// <summary>How long a request waits for the supervisor before giving up.</summary>
|
||||
private static readonly TimeSpan CommandTimeout = TimeSpan.FromSeconds(5);
|
||||
|
||||
public static void MapSchoolEndpoints(this IEndpointRouteBuilder builder)
|
||||
@@ -81,7 +81,7 @@ internal static class SchoolEndpoints
|
||||
.WithName("DeleteSchool");
|
||||
}
|
||||
|
||||
/// <summary>The loop thread must never be blocked by a continuation of a waiting request.</summary>
|
||||
/// <summary>The supervisor must never be blocked by a continuation of a waiting request.</summary>
|
||||
private static TaskCompletionSource<T> NewCompletion<T>() =>
|
||||
new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user