feat: Add GraphRunner API to replace legacy run method. #207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, ezmsg systems written with the high level API (units, collections, etc) are run with
ez.runwhich is a synchronous blocking run function. Wouldn't it be neat if we had a non-blocking run function too?Enter
GraphRunner. This new feature allows users to create a GraphRunner object and call either a blocking or non-blocking run!Are you working on a software that orchestrates a bunch of subgraphs that all run on the same graph server? GraphRunner is your friend and gives you a nice handle to start and programmatically stop (!) your ezmsg systems.
Did you start your graph without a GraphServer running on the canonical ezmsg port, and now your system is running on a "sandboxed" random port? Still want to add more stuff to it? You're in luck, because GraphRunner makes the graph's address available as a property!
All silliness aside, this feature represents a refactor of some pretty gnarly code that has existed in ezmsg since public release.
ezmsg/src/ezmsg/core/backend.py
Lines 227 to 228 in eaf8068