haasafe.blogg.se

Thrift idl
Thrift idl









You could define as many functions as you might need with all types you want to support. In Thrift you are able to use generic vector or map to define specific types, but functions need to be specific, not generic.

thrift idl

Imagine PHP client trying to instantiate some C++ template with class defined in PHP.Īlso - please remember about security issues - passing any code to be executed on server side (template instantiation is in fact form of code execution) without verification is just a bad idea. So that's why it not usually supported to provide user with possibility to instantiate template on server side.įurther mode - Thrift was designed to support cross-platform communication. It would require some strange recompilation and reloading of parts of code during code execution. It also elaborates on the pros and cons of optional and required which also should be considered before you retire fields - you may end up with broken IDL compatibility otherwise.Templates in C++ are instantiated with types at compile time, so there is no way to allow user to provide MyOwnType during runtime. See alsoĪ good read on the topic is Diwaker Gupta's "Missing Guide". With regard to compatibility on the code level, any consumer of your API will highly value it, if you stay away from changing field names too often.

  • Method names may not be changed (unless you know what you are doing).
  • thrift idl

  • All names in Thrift IDL may be changed as needed, except.
  • Changing the name actually declares a new method. Methods do not have numeric identifiers, in that case the name is used.

    thrift idl

    The only place where names are used as names is with service method calls. Even in the case where a field is fully retired, one should comment it out but leave it in the IDL to prevent the numeric field ID from being accidentally reused. They do not even go over the wire.įurthermore, it is a recommended way to deprecate fields. The names of a struct as well as method argument names are used to generate field names in the generated code only.

    thrift idl

    Thrift only deals with field IDs internally.











    Thrift idl