Skip to content

[Query] Add non-generic ReadJournalFor API #7679

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

Conversation

Arkatufus
Copy link
Contributor

@Arkatufus Arkatufus commented Jun 4, 2025

Fixes #7678

Changes

Add non-generic ReadJournalFor API

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

Copy link
Contributor Author

@Arkatufus Arkatufus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self-review

@@ -16,6 +16,8 @@ namespace Akka.Persistence.Query
{
public sealed class PersistenceQuery : IExtension
{
private static readonly Type ReadJournalType = typeof(IReadJournal);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type cache of IReadJournal

@@ -34,18 +36,24 @@ public PersistenceQuery(ExtendedActorSystem system)
}

public TJournal ReadJournalFor<TJournal>(string readJournalPluginId) where TJournal : IReadJournal
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old API is left intact

Comment on lines +43 to +44
if(!ReadJournalType.IsAssignableFrom(readJournalType))
throw new ArgumentException("Must implement IReadJournal interface", nameof(readJournalType));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added type checking code to make sure that readJournalType implements IReadJournal

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb merged commit ec99b8c into akkadotnet:dev Jun 5, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Query] Need a new ReadJournalFor API
2 participants