Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/seungyongshim/seungyongshim.akka


https://github.com/seungyongshim/seungyongshim.akka

akkadotnet ms-di opentelemetry

Last synced: 15 days ago
JSON representation

Awesome Lists containing this project

README

        

![CI](../../workflows/CI/badge.svg)

## 1. SeungYongShim.Akka.DependencyInjection
### Production
``` csharp
[Fact]
public async Task Production()
{
// Arrange
var host = Host.CreateDefaultBuilder()
.UseAkka("ProductionSystem", string.Empty, sys =>
{
sys.ActorOf(sys.PropsFactory().Create(), "Parent");
})
.Build();

await host.StartAsync();
var actorSystem = host.Services.GetService();

// Act
var ret = await actorSystem.ActorSelection("/user/Parent")
.Ask("Hello");

ret.Should().Be("Hello, Kid");

await host.StopAsync();
}
```
### UnitTest using TestActor
```csharp
[Fact]
public async Task Check_Child_Actor_Recieved_Messages()
{
// Arrange
var host = Host.CreateDefaultBuilder()
.UseAkka("TestSystem", string.Empty, sys =>
{
sys.ActorOf(sys.PropsFactory().Create(), "Parent");
})
.UseAkkaWithXUnit2(typeof(ChildActor))
.Build();

await host.StartAsync();

var testKit = host.Services.GetService();

// Act
testKit.ActorSelection("/user/Parent").Tell("Hello");

// Assert
testKit.ExpectMsg().Should().Be("Hello, Kid");

var child1 = await testKit.Sys.ActorSelection("/user/Parent/Child1")
.ResolveOne(5.Seconds());
child1.Path.Name.Should().Be("Child1");

await host.StopAsync();
}
```

## 2. SeungYongShim.Akka.OpenTelemetry
### TraceLocalActorRefProvider Only
* Not Support Remote, Cluster
* Not Support Local Router

![](./images/opentelemetry.png)