Skip to content
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

Preliminary Scopes Implementation #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aidanm3341
Copy link
Member

An initial attempt at implementing scopes to get some ideas and discussions going. I'm wondering if there is a better way to do the instantiation using Needle...

*/
public createScope(scopeName: string): IMessageBroker<T> {
const scope = rootInjector.createScope(scopeName);
scope.registerInstance(MessageBroker, new MessageBroker<T>(new RSVPMediator(), this));

Choose a reason for hiding this comment

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

So we will have a scoped RSVPMediator too. We ok with that? What does that mean? Is it still global in nature under the covers?

@Davidhanson90
Copy link

I think we need some additional docs for this change which details about how messages propagate up and down scopes.

@Davidhanson90
Copy link

What are we doing about scope disposal. I think it needs to be part of this process.

@aidanm3341
Copy link
Member Author

aidanm3341 commented Sep 9, 2024

What are we doing about scope disposal. I think it needs to be part of this process.

That's a good point, there should be a mechanism for disposing of a scope similar to what exists for channels. This also made me realise another point - given that messages on a channel trickle down to the same channel in child scopes, the existing disposal logic should dispose of the same channel in the children.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants