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

Split up Dispatcher #7

Open
kristinapathak opened this issue Aug 7, 2020 · 1 comment
Open

Split up Dispatcher #7

kristinapathak opened this issue Aug 7, 2020 · 1 comment
Labels
feature new functionality proposal/implementation
Projects

Comments

@kristinapathak
Copy link
Contributor

Dispatcher really be two different components/structs/interfaces:

  • one thing that has a queue and decides whether or not to send an event given the device id / norn (give this a different interface name)
  • one thing that is configured to the specific endpoint, which can be used by multiple of the first thing (this should be called the dispatcher since it is actually dispatching the event)

They shouldn't be the same interface, because given the interface here:
https://github.com/xmidt-org/mimisbrunnr/blob/main/dispatch/dispatch.go#L54

  • The filtering struct needs to know the deviceID, but the dispatcher doesn't care.
  • When we add cut off functionality, the interfaces will likely diverge more.

They will likely both need to be updated, but exactly how that works I haven't thought through. Given that multiple filtering interfaces will use the same dispatcher, the manager should have some map/list/something for each dispatcher in order to pass along an existing dispatcher to a newly created filtering struct thing.

Some things I thought of but haven't fully thought through yet:

  • Though they both need to be updated, it might be that the manager will split up a norn's information and update them separately? Also - what happens if just one endpoint is updated with new auth information? (this could be a good reason to have separate dispatchers for each filtering struct but would make it difficult to cut off all dispatchers to a specific endpoint)
  • How do we know a dispatcher is no longer being used by any filtering structs in order to clean it up from the manager?
@kristinapathak kristinapathak added feature new functionality proposal/implementation needs discussion Further discussion is needed to move forward labels Aug 7, 2020
@kristinapathak kristinapathak added this to To do in Codex via automation Aug 7, 2020
@kristinapathak kristinapathak removed the needs discussion Further discussion is needed to move forward label Aug 10, 2020
@kristinapathak
Copy link
Contributor Author

No need for the manager to split up the norn's information - just update both the filterer and the dispatcher with the norn and they can figure it out.

The manager will be responsible for keeping its map of endpoints to dispatchers up to date and pruning out unused ones based on the new list of norns from chrysom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new functionality proposal/implementation
Projects
Codex
  
To do
Development

No branches or pull requests

1 participant