Class ServerRpcQueue


  • public class ServerRpcQueue
    extends Object
    Manages the queue of server invocations (RPC) which are waiting to be sent to the server.
    Since:
    1.0
    Author:
    Vaadin Ltd
    • Constructor Summary

      Constructors 
      Constructor Description
      ServerRpcQueue​(Registry registry)
      Creates a new instance connected to the given registry.
    • Constructor Detail

      • ServerRpcQueue

        public ServerRpcQueue​(Registry registry)
        Creates a new instance connected to the given registry.
        Parameters:
        registry - the global registry
    • Method Detail

      • add

        public void add​(elemental.json.JsonValue invocation)
        Adds an explicit RPC method invocation to the send queue.
        Parameters:
        invocation - RPC method invocation
      • clear

        public void clear()
        Clears the queue.
      • size

        public int size()
        Returns the current size of the queue.
        Returns:
        the number of invocations in the queue
      • isEmpty

        public boolean isEmpty()
        Checks if the queue is empty.
        Returns:
        true if the queue is empty, false otherwise
      • flush

        public void flush()
        Triggers a send of server RPC and legacy variable changes to the server.
      • isFlushPending

        public boolean isFlushPending()
        Checks if a flush operation is pending.
        Returns:
        true if a flush is pending, false otherwise
      • showLoadingIndicator

        public boolean showLoadingIndicator()
        Checks if a loading indicator should be shown when the RPCs have been sent to the server and we are waiting for a response.
        Returns:
        true if a loading indicator should be shown, false otherwise
      • toJson

        public elemental.json.JsonArray toJson()
        Returns the current invocations as JSON.
        Returns:
        the current invocations in a JSON format ready to be sent to the server