slawlor / ractor

Rust actor framework
MIT License
1.31k stars 68 forks source link

Add `Scope`-> `GroupName` mapping #184

Closed leonqadirie closed 5 months ago

leonqadirie commented 7 months ago

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.

To make sure I understand you correctly before tackling this: Are we talking about sth. along the lines of substituting ScopeGroupKey with sth. like this?

pub struct Scope {
    name: ScopeName,
    groups: HashSet<GroupName>,
}
slawlor commented 7 months ago

Sorry again on the delay getting back to you. 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.

leonqadirie commented 7 months ago

No problem, again, take all the time required. Hope all is fine and you get some sleep ;) Will open a PR with what I understood this to be.

slawlor commented 5 months ago

190 resolved this.