Class RemoteFunctionChunkedList


  • public class RemoteFunctionChunkedList
    extends RemoteFunction
    An implementation of RemoteFunction that is intended to call remote functions that return a list of objects in the form of a GluonObservableList. Each object in the list is handled individually from the response of the call to the remote function. The response comes in as chunks from a connection with chunked transfer encoding enabled. This is in contrast with the RemoteFunctionList where all the objects are parsed from the entire response of the call to the remote function.
    • Method Detail

      • call

        public <E> GluonObservableList<E> call​(Class<E> objectClass)
        Triggers a call to the remote function and returns a GluonObservableList that contains the retrieved objects.

        The actual call to the endpoint of the remote function will be handled asynchronously. The response that is returned by the remote function should have chunked transfer encoding enabled. Each chunk that is received while reading from the response will be converted by an automatically determined converter based on the provided objectClass and added to the returned GluonObservableList. Use call(InputStreamInputConverter) to specify a custom converter that can handle the chunks.

        Type Parameters:
        E - the type of the objects contained in the list
        Parameters:
        objectClass - the class of the objects contained in the list
        Returns:
        an instance of GluonObservableList that will hold the retrieved objects upon successful completion of the call to the remote function
      • call

        public <E> GluonObservableList<E> call​(InputStreamInputConverter<E> converter)
        Triggers a call to the remote function and returns a GluonObservableList that contains the retrieved objects.

        The actual call to the endpoint of the remote function will be handled asynchronously. The response that is returned by the remote function should have chunked transfer encoding enabled. Each chunk that is received while reading from the response will be converted by the specified converter and added to the returned GluonObservableList.

        Type Parameters:
        E - the type of the objects contained in the list
        Parameters:
        converter - the converter to use for transforming the chunk into a single object that is added to the list
        Returns:
        an instance of GluonObservableList that will hold the retrieved objects upon successful completion of the call to the remote function