Commit f7a7714c authored by Kenton Varda's avatar Kenton Varda

Let's go ahead and rename to , acknowledging that this may expand to support…

Let's go ahead and rename  to , acknowledging that this may expand to support pipeline operations that are not simply fetching members.
parent 5326ffc7
...@@ -633,34 +633,32 @@ struct PromisedAnswer { ...@@ -633,34 +633,32 @@ struct PromisedAnswer {
# ID of the question (in the sender's question table / receiver's answer table) whose answer is # ID of the question (in the sender's question table / receiver's answer table) whose answer is
# expected to contain the capability. # expected to contain the capability.
path @1 :List(PathPart); transform @1 :List(Op);
# Path to the capability in the response. This is a list of indexes into the pointer # Operations / transformations to apply to the answer in order to get the capability actually
# sections of structs forming a path from the root struct to a particular capability. Each # being addressed. E.g. if the answer is a struct and you want to call a method on a capability
# pointer except for the last one must point to another struct -- it is an error if one ends # pointed to by a field of the struct, you need a `getPointerField` op.
# up pointing to a list or something else.
# struct Op {
# If the question refers to an `Accept` (or anything other than a `Call`), this list must be # If an RPC implementation receives an `Op` of a type it doesn't recognize, it should
# empty. # reply with a `Return` with `unsupportedPipelineOp` set.
struct PathPart {
union { union {
noop @0 :Void; noop @0 :Void;
# Dummy. Ignore this part. This field is only here so that we can define PathPart to be # Does nothing. This member is mostly defined so that we can make `Op` a union even
# a union which we might extend in the future. If an RPC implementation receives a PathPart # though (as of this writing) only one real operation is defined.
# of a type it doesn't recognize, it should reply with a `Return` with `unsupportedPipelineOp`
# set.
pointerIndex @1 :UInt16; getPointerField @1 :UInt16;
# Index of a pointer in the pointer section of a struct. Only valid when addressing a # Get a pointer field within a struct. The number is an index into the pointer section, NOT
# struct. # a field ordinal, so that the receiver does not need to understand the schema.
# TODO(someday): We could add: # TODO(someday): We could add:
# - For lists, the ability to address every member of the list, or a slice of the list, the # - For lists, the ability to address every member of the list, or a slice of the list, the
# answer to which would be another list. This is useful for implementing the equivalent of # answer to which would be another list. This is useful for implementing the equivalent of
# a SQL table join (not to be confused with the `Join` message type). # a SQL table join (not to be confused with the `Join` message type).
# - Maybe some ability to test a union.
# - Probably not a good idea: the ability to specify an arbitrary script to run on the # - Probably not a good idea: the ability to specify an arbitrary script to run on the
# result. We could define a little stack-based / point-free language where `PathPart` # result. We could define a little stack-based language where `PathPart` specifies one
# specifies one "instruction" or transformation to apply. Although this is not a good idea # "instruction" or transformation to apply. Although this is not a good idea
# (over-engineered), any narrower additions to `PathPart` should be designed as if this # (over-engineered), any narrower additions to `PathPart` should be designed as if this
# were the eventual goal. # were the eventual goal.
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment