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

Support nested execution in the planner #8

Open
Arachnid opened this issue Jun 16, 2021 · 0 comments
Open

Support nested execution in the planner #8

Arachnid opened this issue Jun 16, 2021 · 0 comments

Comments

@Arachnid
Copy link
Contributor

If we do this via raw calls, it would work something like this:

  • Add accessors on the planner .state and .commands that return placeholder Value objects representing the executor state and the commands used by a nested instance.
  • Add a function on the planner .createSubplanner (or something). This function takes a FunctionCall, wraps it into a SubplanFunctionCall and puts it on the list of calls, then returns a new planner object initialised with the context of the parent.
  • When planning, if we encounter a SubplanFunctionCall, recurse and plan that call before continuing. Use the same internal state for tracking slot liveness etc, as the same state array will be used throughout all the nested calls.
  • When looking at function arguments and return values, if we encounter a StateValue, encode the special register ID for the state. If we encounter a CommandsValue and the current call is a SubplanFunctionCall, ABI-encode the the list of commands for that subplan and insert as a literal value into the state.
  • If we encounter a CommandsValue in a call that's not a SubplanFunctionCall, throw an error. If we encounter a SubplanFunctionCall that doesn't have a CommandsValue, throw an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant