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

System Lookup Interface #97

Open
pathunstrom opened this issue Aug 31, 2018 · 4 comments
Open

System Lookup Interface #97

pathunstrom opened this issue Aug 31, 2018 · 4 comments
Labels

Comments

@pathunstrom
Copy link
Collaborator

Right now, when one system needed another system, there's no good way to do it.

As part of this issue, we should build an interface to allow this.

Considerations:

  • Should be non-blocking: A system that doesn't have another system shouldn't lock up and should do its best to keep functioning without the other system.
  • Should probably use the existing signalling system to request and respond.
  • Consider a simple callback model.
@AstraLuma
Copy link
Member

These are the kind of operations that don't require IO, or the IO required is synchronous, so making this API async (with callbacks or coroutines) would have little value without future plans to make more of the system async.

This also comes up in other ways:

  • Wiring up the sound system
  • Camera's viewport and Renderer's window coordination
  • System information interrogation (eg, how many mouse buttons there are or what shape of gamepad there is)

@AstraLuma
Copy link
Member

An idea that's been floating around is registering systems (or API proxies) onto events, making them accessible to all event handlers.

While this technique hasn't been used yet, it's an option to implement this?

@pathunstrom
Copy link
Collaborator Author

This has come back up with discussion of dependency injection needs. Still needed, design still isn't finished.

@AstraLuma
Copy link
Member

I think we call this "dependency injection".

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

No branches or pull requests

2 participants