-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved the main sample's docker image to respect the SIGTERM from K…
…ubernetes to perform a graceful shutdown. As a result, the pods shutting down will not vote. Closes Raft - Block voting when node shutdown #18 Better usage of IPMessageEndpoint, so that it does not starve the SWIM messages in case the Raft leader cannot receive a response from its followers. Sample has an example for a distributed counter with exposed API Multi-targeting enabled to take some improvements in the .net6 UDP client Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com>
- Loading branch information
Showing
32 changed files
with
165 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# run with tty console, interactive mode, and remove container after program ends | ||
docker run -it --rm zarusz/slimcluster_samples_consoleapp:latest | ||
docker run -it --rm zarusz/slimcluster_samples_service:latest | ||
|
||
# In case you need to debug why it's not starting: | ||
# docker run -it zarusz/slimcluster_samples_consoleapp:latest sh |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/Samples/SlimCluster.Samples.Service/State/Logs/AbstractCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
namespace SlimCluster.Samples.ConsoleApp.State.Logs; | ||
|
||
public abstract record AbstractCommand | ||
{ | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Samples/SlimCluster.Samples.Service/State/Logs/CommandSerializationTypeAliasProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace SlimCluster.Samples.ConsoleApp.State.Logs; | ||
|
||
using SlimCluster.Serialization; | ||
|
||
internal class CommandSerializationTypeAliasProvider : ISerializationTypeAliasProvider | ||
{ | ||
public IReadOnlyDictionary<string, Type> GetTypeAliases() => new Dictionary<string, Type> | ||
{ | ||
["dec"] = typeof(DecrementCounterCommand), | ||
["inc"] = typeof(IncrementCounterCommand), | ||
["rst"] = typeof(ResetCounterCommand), | ||
}; | ||
} |
1 change: 1 addition & 0 deletions
1
src/Samples/SlimCluster.Samples.Service/State/Logs/ResetCounterCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
namespace SlimCluster.Samples.ConsoleApp.State.Logs; | ||
|
||
/// <summary> | ||
/// Sets the counter to 0 | ||
/// </summary> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.