-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Docs: Updated Cluster Distributed PubSub documentation #5566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Aaronontheweb
merged 14 commits into
akkadotnet:dev
from
eaba:unsubscribe_does_not_terminate_actor_doc
Feb 9, 2022
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
01a1eee
Updated Cluster Distributed PubSub documentation
eaba 2628de3
Fix linting unknown DeadLetter word
eaba 86c8d2a
Fixed lint no-multiple-blank issue
eaba bf988fd
Fix lint unordered list issue
eaba 35171c3
Merge branch 'dev' into unsubscribe_does_not_terminate_actor_doc
Aaronontheweb 97c8e8a
Update distributed-publish-subscribe.md
Aaronontheweb 1952cd0
Update distributed-publish-subscribe.md
Aaronontheweb f5a6da1
Merge branch 'dev' into unsubscribe_does_not_terminate_actor_doc
eaba bc05dbb
Added examples for code referencing
eaba 973f797
Merge branch 'dev' into unsubscribe_does_not_terminate_actor_doc
eaba c9b9d9c
Fixed linting
eaba f3d4de9
Fixed typo
eaba fe81971
Merge branch 'dev' into unsubscribe_does_not_terminate_actor_doc
eaba 09e1e46
Merge branch 'dev' into unsubscribe_does_not_terminate_actor_doc
Aaronontheweb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
27 changes: 27 additions & 0 deletions
27
src/examples/Cluster/PublishSubscribe/SampleDestination/Destination.cs
This file contains hidden or 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,27 @@ | ||
| #region SampleDestination | ||
| using Akka.Actor; | ||
| using Akka.Cluster.Tools.PublishSubscribe; | ||
| using Akka.Event; | ||
|
|
||
| namespace SampleDestination | ||
| { | ||
| public sealed class Destination : ReceiveActor | ||
| { | ||
| private readonly ILoggingAdapter log = Context.GetLogger(); | ||
|
|
||
| public Destination() | ||
| { | ||
| // activate the extension | ||
| var mediator = DistributedPubSub.Get(Context.System).Mediator; | ||
|
|
||
| // register to the path | ||
| mediator.Tell(new Put(Self)); | ||
|
|
||
| Receive<string>(s => | ||
| { | ||
| log.Info($"Got {s}"); | ||
| }); | ||
| } | ||
| } | ||
| #endregion | ||
| } |
28 changes: 28 additions & 0 deletions
28
src/examples/Cluster/PublishSubscribe/SampleDestination/Program.cs
This file contains hidden or 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,28 @@ | ||
| #region destination | ||
| // See https://aka.ms/new-console-template for more information | ||
| using Akka.Actor; | ||
| using Akka.Cluster.Tools.PublishSubscribe; | ||
| using Akka.Configuration; | ||
| using SampleDestination; | ||
| var config = ConfigurationFactory.ParseString(@" | ||
| akka { | ||
| actor.provider = cluster | ||
| extensions = [""Akka.Cluster.Tools.PublishSubscribe.DistributedPubSubExtensionProvider,Akka.Cluster.Tools""] | ||
| remote { | ||
| dot-netty.tcp { | ||
| port = 0 | ||
| hostname = localhost | ||
| } | ||
| } | ||
| cluster { | ||
| seed-nodes = [""akka.tcp://cluster@localhost:5800""] | ||
| } | ||
| }"); | ||
| var actorSystem = ActorSystem.Create("cluster", config); | ||
|
|
||
| DistributedPubSub.Get(actorSystem); | ||
|
|
||
| actorSystem.ActorOf(Props.Create<Destination>(), "destination"); | ||
|
|
||
| actorSystem.WhenTerminated.Wait(); | ||
| #endregion |
16 changes: 16 additions & 0 deletions
16
src/examples/Cluster/PublishSubscribe/SampleDestination/SampleDestination.csproj
This file contains hidden or 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,16 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net6.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\..\..\..\contrib\cluster\Akka.Cluster.Tools\Akka.Cluster.Tools.csproj" /> | ||
| <ProjectReference Include="..\..\..\..\core\Akka.Cluster\Akka.Cluster.csproj" /> | ||
| <ProjectReference Include="..\..\..\..\core\Akka\Akka.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to turn this into a DocFx ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All code samples in this doc need to be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would read better if it was two separate sentences. Also, the repeated verbiage looks out of place. It could be changed to something like
... they are terminated. Termination occurs when there are no ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion cc @eaba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note taken!