slawlor / ractor

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

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

Closed leonqadirie closed 5 months ago

leonqadirie commented 6 months ago

Supersedes #189 and 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.

And sorry for the PR noise :)

-- 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: 4 lines in your changes are missing coverage. Please review.

Comparison is base (8c310e7) 79.73% compared to head (95ec939) 79.75%. Report is 3 commits behind head on main.

Files Patch % Lines
ractor/src/pg/mod.rs 92.45% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #190 +/- ## ========================================== + Coverage 79.73% 79.75% +0.01% ========================================== Files 50 50 Lines 9790 9824 +34 ========================================== + Hits 7806 7835 +29 - Misses 1984 1989 +5 ```

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

leonqadirie commented 5 months ago

Thanks for all the work put into this PR!

It was/is a(n educative) pleasure. I'm learning quite a lot from this code base and your reviews.