[ 
https://issues.apache.org/jira/browse/THRIFT-3979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15688504#comment-15688504
 ] 

Chris Simpson commented on THRIFT-3979:
---------------------------------------

[~jensg] Is there better docs for use of `THeader`?  The above link is 
sufficient for formatting but I've not seen anything for usage.  I'd like to 
implement it in the Swift 3 binding 
https://issues.apache.org/jira/browse/THRIFT-3773.
I built out the Swift 3 library and generator not even knowing `THeader` 
exists, I just stumbled in here randomly from IRC as it happens.  Incidentally 
the pattern we use is very similar to the one described by James wherein the 
1st argument for every function is a meta dict with a sessionID (We have some 
more complicated stuff in a node.js gateway that dynamically injects 
permissions info and more into a map for the services to use as they need).  
Its ugly and could be put in a header thats kept on the client.  For our Swift 
clients, we duplicate code essentially by subclassing and abstracting out the 
1st argument, which is extra work that the generator (or a `THeader` perhaps) 
could eliminate.

> offer TExtendedBinaryProtocol for customers
> -------------------------------------------
>
>                 Key: THRIFT-3979
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3979
>             Project: Thrift
>          Issue Type: Story
>          Components: Wish List
>    Affects Versions: 0.9.3
>            Reporter: Xiaoshuang LU
>            Assignee: Jens Geyer
>
> Sometimes, customers wanna put some options (whatever customers want) in each 
> request and response. And these options ought to be transparent for 
> applications.
> Unfortunately, thrift protocol does not have good extensibility for extra 
> functionalities. I would like to propose the following solution to address 
> this issue.
> 1. TMessage adds a new field called "options"
> 2. customers set "options"
> 3. TExtendedBinaryProtocol writes "options" when "writeMessageBegin" invoked
> 4. TExtendedBinaryProtocol reads "options" when "readMessageBegin" invoked



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to