Ejemplo n.º 1
0
    def read_request_headers(self):
        """
        Reads the request headers out of the underlying TTransportBase and
        return an FContext

        Returns:
            FContext
        """
        headers = _Headers._read(self.get_transport())

        context = FContext()

        for key, value in headers.items():
            context.set_request_header(key, value)

        op_id = headers[_OPID_HEADER]
        context._set_response_op_id(op_id)
        # Put a new opid in the request headers so this context an be
        # used/propagated on the receiver
        context.set_request_header(_OPID_HEADER, _get_next_op_id())

        cid = context.correlation_id
        if cid:
            context.set_response_header(_CID_HEADER, cid)
        return context
Ejemplo n.º 2
0
    def read_response_headers(self, context):
        """Read the response headers from the underlying transport and set them
        on a given FContext

        Returns:
            FContext
        """
        headers = _Headers._read(self.get_transport())

        for key, value in headers.items():
            context._set_response_header(key, value)
Ejemplo n.º 3
0
    def read_response_headers(self, context):
        """
        Read the response headers from the underlying transport
        and set them on a given FContext.

        Returns:
            FContext
        """
        headers = _Headers._read(self.get_transport())

        for key, value in headers.items():
            # Don't want to overwrite the opid header we set for a propagated
            # response
            if key == _OPID_HEADER:
                continue
            context.set_response_header(key, value)
Ejemplo n.º 4
0
    def read_request_headers(self):
        """Reads the request headers out of the underlying TTransportBase and
        return an FContext

        Returns:
            FContext
        """
        headers = _Headers._read(self.get_transport())

        context = FContext()

        for key, value in headers.items():
            context._set_request_header(key, value)

        op_id = headers[_OPID_HEADER]
        context._set_response_op_id(op_id)
        cid = context.correlation_id
        if cid:
            context._set_response_header(_CID_HEADER, cid)
        return context