@Override public void flush() { flushServiceProxy(eventManager); } }
@Override public void flushRequests() { ServiceProxyUtils.flushServiceProxy(keyValueStoreService); } });
@Override public void flushRequests() { ServiceProxyUtils.flushServiceProxy(keyValueStoreService); } });
private void flushReplicas() { if (!ServiceProxyUtils.flushServiceProxy(replica)) { replica.flush(); } }
@Override public void flush() { eventConnector.flush(); ServiceProxyUtils.flushServiceProxy(eventConnector); } }
private void flushReplicator(final Pair<EndpointDefinition, StatReplicator> statReplicator, final List<Pair<EndpointDefinition, StatReplicator>> badReplicators) { try { ServiceProxyUtils.flushServiceProxy(statReplicator.getSecond()); } catch (Exception exception) { badReplicators.add(statReplicator); logger.info("Replicator failed " + statReplicator, exception); } }
private void flushEventManagerCalls() { final EventManager eventManager = factory.eventManagerProxy(); if (eventManager != null) { ServiceProxyUtils.flushServiceProxy(eventManager); factory.clearEventManagerProxy(); } }
/** * flush events. */ @QueueCallback({QueueCallbackType.LIMIT, QueueCallbackType.EMPTY}) void process() { ServiceProxyUtils.flushServiceProxy(eventManager); } }
/** * flush events. */ @QueueCallback({QueueCallbackType.LIMIT, QueueCallbackType.EMPTY}) void process() { ServiceProxyUtils.flushServiceProxy(recordChannel); } }
/** * flush events. */ @QueueCallback({QueueCallbackType.LIMIT, QueueCallbackType.EMPTY}) void process() { ServiceProxyUtils.flushServiceProxy(eventManager); } }
/** * Start this. */ public void start() { server.setHttpRequestConsumer(proxyService::handleRequest); server.setHttpRequestsIdleConsumer(aVoid -> flushServiceProxy(proxyService)); server.startServer(); }
public boolean hasKey(String key) throws InterruptedException { final CountDownLatch getLatch = new CountDownLatch(1); final AtomicBoolean reference = new AtomicBoolean(); kvStore.hasKey(present -> { reference.set(present); getLatch.countDown(); }, key); Sys.sleep(100); ServiceProxyUtils.flushServiceProxy(kvStore); getLatch.await(2, TimeUnit.SECONDS); return reference.get(); }
public Optional<Todo> getTodoForKey(String key) throws InterruptedException { final CountDownLatch getLatch = new CountDownLatch(1); final AtomicReference<Optional<Todo>> reference = new AtomicReference<>(); kvStore.get(todo -> { reference.set(todo); getLatch.countDown(); }, key); Sys.sleep(100); ServiceProxyUtils.flushServiceProxy(kvStore); getLatch.await(2, TimeUnit.SECONDS); assertNotNull(reference.get()); return reference.get(); }
@Test public void testWithReturn() { final MultiWorkerClient worker = bundle.createLocalProxy(MultiWorkerClient.class, "/workers"); final AtomicInteger callbackCounter = new AtomicInteger(); for (int index = 0; index < 200; index++) { worker.doSomeWork2(integer -> callbackCounter.incrementAndGet()); } ServiceProxyUtils.flushServiceProxy(worker); super.waitForTrigger(30, o -> callbackCounter.get() >= 200); assertEquals(200, callbackCounter.get()); }
@Test public void test() { final MultiWorkerClient worker = bundle.createLocalProxy(MultiWorkerClient.class, "/workers"); for (int index = 0; index < 200; index++) { worker.doSomeWork(); } Sys.sleep(100); ServiceProxyUtils.flushServiceProxy(worker); Sys.sleep(100); ServiceProxyUtils.flushServiceProxy(worker); super.waitForTrigger(30, o -> MultiWorker.totalCount >= 90); ok = MultiWorker.totalCount >= 90 || die(MultiWorker.totalCount); }
@Test public void test() throws InterruptedException { kvStore.put("testKey", new Todo("testValue")); ServiceProxyUtils.flushServiceProxy(kvStore); Sys.sleep(100); final Optional<Todo> todoOptional = getTodoForKey("testKey"); assertTrue(todoOptional.isPresent()); assertEquals("testValue", todoOptional.get().name); final Optional<String> todoForKeyFromBacking = getTodoForKeyFromBacking("testKey"); assertTrue(todoForKeyFromBacking.isPresent()); assertEquals("{\"name\":\"testValue\"}", todoForKeyFromBacking.get()); }
@Test public void test() { final AsyncFutureCallback<Boolean> callback = AsyncFutureBuilder .asyncFutureBuilder().setSupportLatch(true).build(Boolean.class); foo.getValue(callback); ServiceProxyUtils.flushServiceProxy(foo); final Boolean result = callback.get(); assertTrue(result); }
private void test5(ServiceDiscovery serviceDiscovery) { final Promise<Integer> promise = Promises.blockingPromiseInt(); serviceDiscovery.five().asHandler().invokeWithPromise(promise.asHandler()); ServiceProxyUtils.flushServiceProxy(serviceDiscovery); assertTrue(promise.asHandler().success()); assertEquals(new Integer(5), promise.asHandler().get()); }
@Test public void test5() { final Promise<Integer> promise = blockingPromiseInt(); serviceDiscoveryWebSocket.five().asHandler().invokeWithPromise(promise.asHandler()); flushServiceProxy(serviceDiscoveryWebSocket); assertTrue(promise.asHandler().success()); assertEquals(new Integer(5), promise.asHandler().get()); }
@Test public void testOk() { final Promise<Boolean> promise = blockingPromiseBoolean(); serviceDiscoveryWebSocket.ok().asHandler().invokeWithPromise(promise.asHandler()); flushServiceProxy(serviceDiscoveryWebSocket); assertTrue(promise.asHandler().success()); assertTrue(promise.asHandler().get()); }