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

Replace Service Manager with Provider #2133

Merged
merged 6 commits into from
Jul 7, 2020
Merged

Conversation

dualspiral
Copy link
Contributor

@dualspiral dualspiral commented Jun 27, 2020

SpongeAPI | SpongeCommon

@Zidane For discussion. Very proof of concept-y, but this was what I was thinking. Plugin recieves event. Plugin chooses whether to supply to event. Event only sent to a plugin if:

  • It is named as the provider for the given service in the config (see Common)
  • There is no named provider and a registration hasn't been successfully made yet

You'll see in Common that I send the event to one plugin at a time. I've not added the service provider to Game or Sponge yet, that's part of the discussion!

Vanilla/Sponge services have low priority and will always be created last (or as a fallback to a named provider that failed to load)

@dualspiral dualspiral added the api: 8 (u) version: 1.16 (unsupported since Oct 17th 2023) label Jun 27, 2020
Copy link
Member

@ST-DDT ST-DDT left a comment

Choose a reason for hiding this comment

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

Interesting concept.
But how do I get access to the ServiceProvider? AFAICT there is no longer a static way to get that instance.

@dualspiral
Copy link
Contributor Author

But how do I get access to the ServiceProvider? AFAICT there is no longer a static way to get that instance.

You need to remember that this is a proof of concept and is a draft - something that's come up after discussion with Zidane. Because init is still up in the air and it's not clear where the access will go, I've not added it, and that's concious. It will be added.

This concept may not go futher - if it does, I'll expend the effort then.

@dualspiral dualspiral force-pushed the api8/service-registration branch from 63f4557 to acdd90b Compare July 4, 2020 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: 8 (u) version: 1.16 (unsupported since Oct 17th 2023)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants