I'm in the process of writing an interactive debugger for capnp. It's easy 
enough to manually provide a schema when connecting to another peer, but I 
think it would be good long-term to support dynamic introspection as a 
feature of the RPC system.

I'm quite new to capnp in general, but after reading over the 
documentation, I think the best way to do this is for capnp to dictate a 
standardized optional interface which returns the original 
CodeGeneratorRequest that was used to implement the peer. Ideally, the code 
generator could automatically implement this interface for every generated 
interface, or perhaps the capnp library could automatically implement for 
on Bootstrap and Accept capabilities. When interacting with services which 
don't support introspection (possibly because of space, security, or other 
concerns), the method call simply fails because it refers to an invalid 
interface ID. The important thing is that such an interface has to have a 
fixed ID to be useful, which is why I think it should be established as a 
core part of capnp.

Here is my straw man version of this interface. I've selected AnyPointer so 
that implementing this interface doesn't require pulling the entire capnp 
schema into your own schema. Since the capnp schema is known to both 
parties (even if it's a different version), this is fine.

interface Introspectable {
  codeGeneratorRequest @0 () -> (cgr :AnyPointer);
}

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/131b69c1-8782-4935-97d0-6fd11fa31e06n%40googlegroups.com.

Reply via email to