Skip to content

Commit

Permalink
Merge branch 'Query_Expose_tags_in_EventEnvelope' of github.com:Arkat…
Browse files Browse the repository at this point in the history
…ufus/akka.net into Query_Expose_tags_in_EventEnvelope
  • Loading branch information
Arkatufus committed Jul 31, 2023
2 parents a308f6e + 6dc5642 commit e28dc5b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

![Akka.NET logo](https://raw.githubusercontent.com/akkadotnet/akka.net/dev/docs/shfb/icons/AkkaNetLogo.Normal.png)

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/akkadotnet/akka.net?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Akka.NET Discord server](https://img.shields.io/discord/974500337396375553?label=Discord)](https://discord.gg/GSCfPwhbWP)
[![NuGet](https://img.shields.io/nuget/v/Akka.svg?style=flat-square)](https://www.nuget.org/packages/Akka)
[![Nuget](https://img.shields.io/nuget/dt/Akka)](https://www.nuget.org/packages/Akka)


**[Akka.NET](https://getakka.net/)** is a .NET port of the popular [Akka project](https://akka.io/) from the Scala / Java community. We are an idiomatic [.NET implementation of the actor model](https://petabridge.com/blog/akkadotnet-what-is-an-actor/) built on top of the .NET Common Language Runtime.

Expand Down
2 changes: 1 addition & 1 deletion docs/articles/clustering/member-roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ var storage = system.ActorOf<Storage>("storage");
var webRouter = system.ActorOf(Props.Empty.WithRouter(FromConfig.Instance),"webdispatcher");
var fraudRouter = system.ActorOf(Props.Empty.WithRouter(FromConfig.Instance),"frauddispatcher");
var orderRouter = system.ActorOf(Props.Empty.WithRouter(FromConfig.Instance),"orderdispatcher");
var billingRouter = system.ActorOf(Props.Empty.WithRouter(FromConfig.Instance),"billingispatcher");
var billingRouter = system.ActorOf(Props.Empty.WithRouter(FromConfig.Instance),"billingdispatcher");
var storageRouter = system.ActorOf(Props.Empty.WithRouter(FromConfig.Instance),"storagedispatcher");
```

Expand Down
15 changes: 13 additions & 2 deletions src/core/Akka.Persistence.Query/PersistenceQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public sealed class PersistenceQuery : IExtension
private readonly ExtendedActorSystem _system;
private readonly ConcurrentDictionary<string, IReadJournal> _readJournalPluginExtensionIds = new();
private ILoggingAdapter _log;
private readonly object _lock = new ();

public static PersistenceQuery Get(ActorSystem system)
{
Expand All @@ -34,8 +35,18 @@ public PersistenceQuery(ExtendedActorSystem system)

public TJournal ReadJournalFor<TJournal>(string readJournalPluginId) where TJournal : IReadJournal
{
var plugin = _readJournalPluginExtensionIds.GetOrAdd(readJournalPluginId, path => CreatePlugin(path, GetDefaultConfig<TJournal>()).GetReadJournal());
return (TJournal)plugin;
if(_readJournalPluginExtensionIds.TryGetValue(readJournalPluginId, out var plugin))
return (TJournal)plugin;

lock (_lock)
{
if (_readJournalPluginExtensionIds.TryGetValue(readJournalPluginId, out plugin))
return (TJournal)plugin;

plugin = CreatePlugin(readJournalPluginId, GetDefaultConfig<TJournal>()).GetReadJournal();
_readJournalPluginExtensionIds[readJournalPluginId] = plugin;
return (TJournal)plugin;
}
}

private IReadJournalProvider CreatePlugin(string configPath, Config config)
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka/Akka.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Polyfill" Version="1.23.0" PrivateAssets="all" />
<PackageReference Include="Polyfill" Version="1.24.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="7.0.8" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
Expand Down

0 comments on commit e28dc5b

Please sign in to comment.