/// <summary> /// Query all <see cref="T:Akka.Persistence.PersistentActor" /> identifiers, i.e. as defined by the /// `persistenceId` of the <see cref="T:Akka.Persistence.PersistentActor" />. /// /// The stream is not completed when it reaches the end of the currently used `persistenceIds`, /// but it continues to push new `persistenceIds` when new persistent actors are created. /// Corresponding query that is completed when it reaches the end of the currently /// used `persistenceIds` is provided by <see cref="M:Akka.Persistence.Query.ICurrentPersistenceIdsQuery.CurrentPersistenceIds" />. /// /// *Please note*, to use this feature, you need to enable `$streams` built-in projection in EventStore server. Please refer to /// EventStore server documentation to find out how. /// </summary> public Source <string, NotUsed> PersistenceIds() { var publisherProps = AllPersistenceIdsPublisher.Props(true, _writeJournalPluginId); return(Source .ActorPublisher <string>(publisherProps) .MapMaterializedValue(_ => NotUsed.Instance) .Named("AllPersistenceIds")); }
/// <summary> /// Same type of query as <see cref="PersistenceIds"/> but the stream /// is completed immediately when it reaches the end of the "result set". Persistent /// actors that are created after the query is completed are not included in the stream. /// </summary> public Source <string, NotUsed> CurrentPersistenceIds() => Source.ActorPublisher <string>(AllPersistenceIdsPublisher.Props(false, _writeJournalPluginId)) .MapMaterializedValue(_ => NotUsed.Instance) .Named("CurrentPersistenceIds") as Source <string, NotUsed>;