public PrimaryElectorService() { super(PrimaryElectorType.instance()); }
@Override @SuppressWarnings("unchecked") public CompletableFuture<PrimaryElectionService> start() { return partitions.getPartitions().iterator().next().getClient() .sessionBuilder(PRIMITIVE_NAME, PrimaryElectorType.instance(), new ServiceConfig()) .build() .connect() .thenAccept(proxy -> { this.proxy = proxy; proxy.addEventListener(CHANGE, eventListener); started.set(true); }) .thenApply(v -> this); }