def build_raw_request_message(self, request, args, is_completed=False):
        """build protocol level message based on request and args.

        request object contains meta information about outgoing request.
        args are the currently chunk data from argstreams
        is_completed tells the flags of the message

        :param request: Request
        :param args: array of arg streams
        :param is_completed: message flags
        :return: CallRequestMessage/CallRequestContinueMessage
        """
        request.flags = FlagsType.none if is_completed else FlagsType.fragment

        # TODO decide what need to pass from request
        if request.state == StreamState.init:
            message = CallRequestMessage(
                flags=request.flags,
                ttl=request.ttl * 1000,
                tracing=request.tracing,
                service=request.service,
                headers=request.headers,
                checksum=request.checksum,
                args=args
            )
            request.state = (StreamState.completed if is_completed
                             else StreamState.streaming)
        elif request.state == StreamState.streaming:
            message = CallRequestContinueMessage(
                flags=request.flags,
                checksum=request.checksum,
                args=args
            )
            request.state = (StreamState.completed if is_completed
                             else StreamState.streaming)

        message.id = request.id
        return message
def build_raw_request_message ( self , request , args , is_completed = False ) : request . flags = FlagsType . none if is_completed else FlagsType . fragment if request . state == StreamState . init : message = CallRequestMessage ( flags = request . flags , ttl = request . ttl * 1000 , tracing = request . tracing , service = request . service , headers = request . headers , checksum = request . checksum , args = args ) request . state = ( StreamState . completed if is_completed else StreamState . streaming ) elif request . state == StreamState . streaming : message = CallRequestContinueMessage ( flags = request . flags , checksum = request . checksum , args = args ) request . state = ( StreamState . completed if is_completed else StreamState . streaming ) message . id = request . id return message
build protocol level message based on request and args.

        request object contains meta information about outgoing request.
        args are the currently chunk data from argstreams
        is_completed tells the flags of the message

        :param request: Request
        :param args: array of arg streams
        :param is_completed: message flags
        :return: CallRequestMessage/CallRequestContinueMessage