Search in sources :

Example 1 with CampaignRequest

use of io.etcd.jetcd.api.CampaignRequest in project jetcd by coreos.

the class ElectionImpl method campaign.

@Override
public CompletableFuture<CampaignResponse> campaign(ByteSequence electionName, long leaseId, ByteSequence proposal) {
    checkNotNull(electionName, "election name should not be null");
    checkNotNull(proposal, "proposal should not be null");
    CampaignRequest request = CampaignRequest.newBuilder().setName(Util.prefixNamespace(electionName, namespace)).setValue(ByteString.copyFrom(proposal.getBytes())).setLease(leaseId).build();
    return completable(stub.campaign(request), CampaignResponse::new, this::convertException);
}
Also used : CampaignResponse(io.etcd.jetcd.election.CampaignResponse) CampaignRequest(io.etcd.jetcd.api.CampaignRequest)

Aggregations

CampaignRequest (io.etcd.jetcd.api.CampaignRequest)1 CampaignResponse (io.etcd.jetcd.election.CampaignResponse)1