Class RemoteCall<T>

  • Type Parameters:
    T - Our return type.
    Direct Known Subclasses:
    RemoteFunctionCall

    public class RemoteCall<T>
    extends java.lang.Object
    A common type for wrapping remote requests.
    • Constructor Summary

      Constructors 
      Constructor Description
      RemoteCall​(java.util.concurrent.Callable<T> callable)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.reactivex.Flowable<T> flowable()
      Provide an flowable to emit result from our function.
      T send()
      Perform request synchronously.
      java.util.concurrent.CompletableFuture<T> sendAsync()
      Perform request asynchronously with a future.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RemoteCall

        public RemoteCall​(java.util.concurrent.Callable<T> callable)
    • Method Detail

      • send

        public T send()
               throws java.lang.Exception
        Perform request synchronously.
        Returns:
        result of enclosed function
        Throws:
        java.lang.Exception - if the function throws an exception
      • sendAsync

        public java.util.concurrent.CompletableFuture<T> sendAsync()
        Perform request asynchronously with a future.
        Returns:
        a future containing our function
      • flowable

        public io.reactivex.Flowable<T> flowable()
        Provide an flowable to emit result from our function.
        Returns:
        an flowable