Closed 21Bruce closed 9 months ago
Working on this next
Implemented a basic API multiplexing scheme at the AppCtx level, need to push this changed downstream to ResolvedCLi
Note:
To address API swaps(which requires parsing of different login flags), I've implemented a new cli Flag API called an 'arbitrator'. Basically, an arbitrator is a function that takes in a list of the flag's arguments and outputs a list of flags. When a flag is parsed, if it has an arbitrator, the arbitrator will get run with the flag's arguments as input and the output flag list will be appended to the parser's working flag list. This way, we can implement an -a|--api
flag, which will dynamically change the parser depending on its input argument. Will probably update ResolvedCLI with this new feature tonight or tomorrow night
Is there an existing issue for this feature?
Description of the problem
Now that there are two APIs, the AppCtx object should be improved to allow for multiple API objects and multiplex properly between them. This will affect developers and end-users, as well as any current applications.
Planned Solution
My solution will introduce the ability to register multiple APIs to the AppCtx object, and restructure the semantics of API calls to force them to specify which API to perform scheduling ops on.
Alternatives
I've considered moving the multiplexing to the runnable layer, so like each runnable makes a separate app context for each api, but then that defeats the point of the common api interface almost, plus I wouldn't want to redo multiplexing logic across runnables
Solution Specifics
I'll update this with more specifics in a few days