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
using System; | |
using Akka.Actor; | |
using Akka.Routing; | |
namespace Akka.RouterStrategies | |
{ | |
class Program | |
{ | |
static void Main(string[] args) { | |
var system = ActorSystem.Create("failboat"); |
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
2015-07-08 14:10:41.588 +02:00 [Information] "Message DeathWatchNotification from akka://Importer/user/stamdata/importRouter/$b/processor to akka://Importer/user/stamdata/importRouter/$b/processor was not delivered. 1 dead letters encountered." | |
2015-07-08 14:10:41.589 +02:00 [Information] "Message DeathWatchNotification from akka://Importer/user/stamdata/importRouter/$b to akka://Importer/user/stamdata/importRouter/$b was not delivered. 2 dead letters encountered." | |
2015-07-08 14:10:41.589 +02:00 [Information] "Message DeathWatchNotification from akka://Importer/user/stamdata/importRouter/$b/processor/database to akka://Importer/user/stamdata/importRouter/$b/processor/database was not delivered. 3 dead letters encountered." | |
2015-07-08 14:10:41.590 +02:00 [Information] "Message DeathWatchNotification from akka://Importer/user/stamdata/importRouter/$b to akka://Importer/user/stamdata/importRouter/$b was not delivered. 4 dead letters encountered." | |
2015-07-08 14:10:41.591 +02:00 [Information] "Message DeathWatchNo |
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
public abstract class BackoffProtocol | |
{ | |
/// <summary> | |
/// I made the TrackedMsg generic so you wont have to do manual matching in your child actor. | |
/// Downside is, that it limits your communication options with the child actor. | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
[Serializable] | |
public sealed class TrackedMsg<T> | |
{ |
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
class AskAggregator<TReq, TRep> : ReceiveActor | |
{ | |
public AskAggregator(IActorRef askFor, IActorRef replyTo, IEnumerable<TReq> items) | |
{ | |
var requestCount = items.Count(); | |
var replies = new HashSet<TRep>(); | |
foreach (var request in items) | |
askFor.Tell(request); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
<section name="akka" type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka"/> | |
</configSections> | |
<akka> | |
<hocon> | |
akka { | |
stdout-loglevel = DEBUG |
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
public static class SerializerTestHelpers | |
{ | |
public static async Task<T> AkkaSerialized<T>(this T src) | |
{ | |
var hocon = "akka.actor.provider = \"Akka.Remote.RemoteActorRefProvider, Akka.Remote\"" + | |
Environment.NewLine + | |
"akka.remote.helios.tcp.port = 0" + Environment.NewLine + | |
"akka.remote.helios.tcp.hostname = localhost"; | |
var sys = ActorSystem.Create("src");//, ConfigurationFactory.ParseString(hokon)); | |
await sys.Terminate(); |
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
cluster { | |
seed-nodes = ["akka.tcp://TradingRoomActors@localhost:8083"] | |
roles = ["traderworker"] | |
singleton { | |
singleton-name = "TraderActor" | |
role = "traderworker" | |
hand-over-retry-interval = 1s | |
} | |
singleton-proxy { | |
singleton-name = "TradesActor" |
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
Premise: | |
We need an extra manifest column for EventAdapters. Because SerializerWithStringManifest type serializers are not compatible. | |
Findings: | |
EventAdapters are registered via an ActorSystem extension. And they are utilised based on an type -> adapter mapper. Which means if you want to utilise them you have to provide a mapping for the message type you want to use it on. Same concept as how serialization-bindings work. | |
EventAdapters are layered in the persistence system. Like a layer of a sandwich :P. |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);PackReferencedProjectOutputs</TargetsForTfmSpecificBuildOutput> | |
</PropertyGroup> | |
// we put this target in an props file and import it | |
<Target Name="PackReferencedProjectOutputs" DependsOnTargets="BuildOnlySettings;ResolveReferences"> | |
<ItemGroup> | |
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" /> |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);PackReferencedProjectOutputs</TargetsForTfmSpecificBuildOutput> | |
</PropertyGroup> | |
// we put this target in an props file and import it | |
<Target Name="PackReferencedProjectOutputs" DependsOnTargets="BuildOnlySettings;ResolveReferences"> | |
<ItemGroup> | |
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" /> |