Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5164

Go middleware support

    XMLWordPrintableJSON

Details

    Description

      I saw that this idea was discussed before in THRIFT-4553, but want to reopen the discussion to see if there's a change of mind.

      We (Reddit) recently implemented TProcessor level middleware support in our Baseplate.go library, and we think that our implementation is generic enough that it might make sense to contribute that into the thrift library. The related implementation are all in this file: https://github.com/reddit/baseplate.go/blob/4225e42dc8dde56b222ac7ea3a4ff63aa726f6a6/thriftbp/middlewares.go

      https://github.com/reddit/baseplate.go/blob/4225e42dc8dde56b222ac7ea3a4ff63aa726f6a6/tracing/middlewares.go#L40-L64 is an example of how a tracing middleware is implemented.

      If we think that's a good idea, then we can contribute that into thrift repo (with renames, of course). One implementation detail I'm not sure is that whether we want to expand the TProcessor interface to also include ProcessorMap and AddToProcessorMap, or do we want to keep the two iinterfaces separate.

      Attachments

        Activity

          People

            dcelasun Duru Can Celasun
            fishywang Yuxuan Wang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h
                2h