Beispiel #1
0
    def _cbFinishRequest(self, results, request, is_batch):
        """
        Manages sending the response to the client and finishing the request.
        This gets called after all methods have returned.

        @type results: list
        @param results: List of tuples (success, result) what DeferredList
            returned.

        @type request: t.w.s.Request
        @param request: The request that came from a client

        @TODO: document is_batch
        """

        method_responses = []
        for (success, result) in results:
            if result is not None:
                method_responses.append(result)

        if not is_batch and len(method_responses) == 1:
            method_responses = method_responses[0]

        response = jsonrpc.prepareCallResponse(method_responses)
        self._sendResponse(response, request)
Beispiel #2
0
    def _cbFinishRequest(self, results, request, is_batch):
        """
        Manages sending the response to the client and finishing the request.
        This gets called after all methods have returned.

        @type results: list
        @param results: List of tuples (success, result) what DeferredList
            returned.

        @type request: t.w.s.Request
        @param request: The request that came from a client

        @TODO: document is_batch
        """

        method_responses = []
        for (success, result) in results:
            if result is not None:
                method_responses.append(result)

        if not is_batch and len(method_responses) == 1:
            method_responses = method_responses[0]

        response = jsonrpc.prepareCallResponse(method_responses)
        self._sendResponse(response, request)
Beispiel #3
0
    def _cbFinishRequest(self, results, is_batch):
        """
        Manages sending the response to the client and finishing the request.
        This gets called after all methods have returned.

        @type results: list
        @param results: List of tuples (success, result) what DeferredList
            returned.

        @type is_batch: bool
        @param is_batch: True if the request was a batch, False if it wasn't
        """

        method_responses = []
        for (success, result) in results:
            if result is not None:
                method_responses.append(result)

        if not is_batch and len(method_responses) == 1:
            method_responses = method_responses[0]

        response = jsonrpc.prepareCallResponse(method_responses)
        self._sendResponse(response)
    def _cbFinishRequest(self, results, is_batch):
        """
        Manages sending the response to the client and finishing the request.
        This gets called after all methods have returned.

        @type results: list
        @param results: List of tuples (success, result) what DeferredList
            returned.

        @type is_batch: bool
        @param is_batch: True if the request was a batch, False if it wasn't
        """

        method_responses = []
        for (success, result) in results:
            if result is not None:
                method_responses.append(result)

        if not is_batch and len(method_responses) == 1:
            method_responses = method_responses[0]

        response = jsonrpc.prepareCallResponse(method_responses)
        self._sendResponse(response)