Class ElectionGrpc.ElectionBlockingStub

  • Enclosing class:
    ElectionGrpc

    public static final class ElectionGrpc.ElectionBlockingStub
    extends io.grpc.stub.AbstractBlockingStub<ElectionGrpc.ElectionBlockingStub>
     The election service exposes client-side election facilities as a gRPC interface.
     
    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.grpc.stub.AbstractStub

        io.grpc.stub.AbstractStub.StubFactory<T extends io.grpc.stub.AbstractStub<T>>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected ElectionGrpc.ElectionBlockingStub build​(io.grpc.Channel channel, io.grpc.CallOptions callOptions)  
      CampaignResponse campaign​(CampaignRequest request)
      Campaign waits to acquire leadership in an election, returning a LeaderKey representing the leadership if successful.
      LeaderResponse leader​(LeaderRequest request)
      Leader returns the current election proclamation, if any.
      java.util.Iterator<LeaderResponse> observe​(LeaderRequest request)
      Observe streams election proclamations in-order as made by the election's elected leaders.
      ProclaimResponse proclaim​(ProclaimRequest request)
      Proclaim updates the leader's posted value with a new value.
      ResignResponse resign​(ResignRequest request)
      Resign releases election leadership so other campaigners may acquire leadership on the election.
      • Methods inherited from class io.grpc.stub.AbstractBlockingStub

        newStub, newStub
      • Methods inherited from class io.grpc.stub.AbstractStub

        getCallOptions, getChannel, withCallCredentials, withChannel, withCompression, withDeadline, withDeadlineAfter, withExecutor, withInterceptors, withMaxInboundMessageSize, withMaxOutboundMessageSize, withOption, withWaitForReady
      • Methods inherited from class java.lang.Object

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

      • campaign

        public CampaignResponse campaign​(CampaignRequest request)
         Campaign waits to acquire leadership in an election, returning a LeaderKey
         representing the leadership if successful. The LeaderKey can then be used
         to issue new values on the election, transactionally guard API requests on
         leadership still being held, and resign from the election.
         
      • observe

        public java.util.Iterator<LeaderResponse> observe​(LeaderRequest request)
         Observe streams election proclamations in-order as made by the election's
         elected leaders.
         
      • resign

        public ResignResponse resign​(ResignRequest request)
         Resign releases election leadership so other campaigners may acquire
         leadership on the election.