slawlor / ractor

Rust actor framework
MIT License
1.3k stars 66 forks source link

`pg`: Add `ScopeName` -> `Vec<GroupName>` mapping #189

Closed leonqadirie closed 6 months ago

leonqadirie commented 6 months ago

Introduces an index field to the PgState struct to map ScopeName to Vec<GroupName>.

If this isn't what was in mind, I'd need another pointer :) Would also be open to refactoring the index's value and the modules Vec<...>-method returns to HashSets if that makes more sense.

-- Relating to https://github.com/slawlor/ractor/pull/177#discussion_r1363016547

This is where having another index might be helpful, i.e. Scope -> Group name in a separate mapping. But that's an optimization that can be added in the future.

and https://github.com/slawlor/ractor/issues/184#issuecomment-1846273238

I meant another global index linking the scopes to groups. So you could efficiently lookup the groups from a given scope. This would remove some scan operations but it is a minimal operation.

codecov[bot] commented 6 months ago

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (c1bce01) 79.49% compared to head (f63ccf9) 79.72%. Report is 2 commits behind head on main.

:exclamation: Current head f63ccf9 differs from pull request most recent head 70e033a. Consider uploading reports for the commit 70e033a to get more accurate results

Files Patch % Lines
ractor/src/actor/tests/mod.rs 89.13% 5 Missing :warning:
ractor/src/pg/tests.rs 95.00% 2 Missing :warning:
ractor/src/pg/mod.rs 96.42% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #189 +/- ## ========================================== + Coverage 79.49% 79.72% +0.22% ========================================== Files 50 50 Lines 9671 9780 +109 ========================================== + Hits 7688 7797 +109 Misses 1983 1983 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

leonqadirie commented 6 months ago

Sorry I messed up my Git history here. Will reopen a hopefully cleaner PR...