本文整理了Java中io.advantageous.qbit.queue.Queue.sendQueueWithAutoFlush
方法的一些代码示例,展示了Queue.sendQueueWithAutoFlush
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Queue.sendQueueWithAutoFlush
方法的具体详情如下:
包路径:io.advantageous.qbit.queue.Queue
类名称:Queue
方法名:sendQueueWithAutoFlush
暂无
代码示例来源:origin: advantageous/qbit
@Override
public SendQueue<MethodCall<Object>> requestsWithAutoFlush(int flushInterval, TimeUnit timeUnit) {
return requestQueue.sendQueueWithAutoFlush(flushInterval, timeUnit);
}
代码示例来源:origin: advantageous/qbit
@Override
public SendQueue<Event<Object>> events() {
return this.eventQueue.sendQueueWithAutoFlush(50, TimeUnit.MILLISECONDS);
}
代码示例来源:origin: advantageous/qbit
/**
* Create a wrapper SendQueue that encoders the objects to JSON
* before putting them into the queue.
*
* @param interval interval
* @param timeUnit timeUnit
* @return returns wrapped SendQueue tht does JSON encoding.
*/
@Override
public SendQueue<T> sendQueueWithAutoFlush(int interval, TimeUnit timeUnit) {
final SendQueue<String> sendQueue = queue.sendQueueWithAutoFlush(interval, timeUnit);
return createJsonSendQueue(sendQueue);
}
代码示例来源:origin: advantageous/qbit
/**
* Create a wrapper SendQueue that encoders the objects to JSON
* before putting them into the queue.
*
* @param periodicScheduler periodicScheduler
* @param interval interval
* @param timeUnit timeUnit
* @return sendQueue
*/
@Override
public SendQueue<T> sendQueueWithAutoFlush(PeriodicScheduler periodicScheduler, int interval, TimeUnit timeUnit) {
final SendQueue<String> sendQueue = queue.sendQueueWithAutoFlush(periodicScheduler, interval, timeUnit);
return createJsonSendQueue(sendQueue);
}
代码示例来源:origin: advantageous/qbit
default SendQueue<T> sendQueueWithAutoFlush(final int interval, final TimeUnit timeUnit) {
PeriodicScheduler periodicScheduler = QBit.factory().periodicScheduler();
return sendQueueWithAutoFlush(periodicScheduler, interval, timeUnit);
}
代码示例来源:origin: advantageous/qbit
public <T> T createProxyWithAutoFlush(final Class<T> serviceInterface,
final PeriodicScheduler periodicScheduler,
final int interval, final TimeUnit timeUnit) {
final SendQueue<MethodCall<Object>> methodCallSendQueue =
requestQueue.sendQueueWithAutoFlush(periodicScheduler, interval, timeUnit);
methodCallSendQueue.start();
return proxy(serviceInterface, methodCallSendQueue);
}
代码示例来源:origin: advantageous/qbit
public <T> T createProxyWithAutoFlush(Class<T> serviceInterface, int interval, TimeUnit timeUnit) {
final SendQueue<MethodCall<Object>> methodCallSendQueue = requestQueue.sendQueueWithAutoFlush(interval, timeUnit);
methodCallSendQueue.start();
return proxy(serviceInterface, methodCallSendQueue);
}
代码示例来源:origin: advantageous/qbit
public WebSocketTextQueue(final WebSocket webSocket, final int batchSize, final int flushInterval, final TimeUnit timeUnit) {
this.webSocket = webSocket;
this.stringQueue = QueueBuilder.queueBuilder().setBatchSize(batchSize).setPollWait(1000).build();
final SendQueue<String> sendQueue = this.stringQueue.sendQueueWithAutoFlush(flushInterval, timeUnit);
this.webSocket.setTextMessageConsumer(sendQueue::send);
}
代码示例来源:origin: advantageous/qbit
this.responseQueue = responseQueueBuilder.setName("Response Queue " + address).build();
this.webResponseQueue = webResponseQueueBuilder.setName("Web Response Queue " + address).build();
this.methodSendQueue = methodQueue.sendQueueWithAutoFlush(10, TimeUnit.SECONDS);
this.eventManager = eventManager;
代码示例来源:origin: com.github.advantageous/qbit-core
@Override
public SendQueue<MethodCall<Object>> requestsWithAutoFlush(int flushInterval, TimeUnit timeUnit) {
return requestQueue.sendQueueWithAutoFlush(flushInterval, timeUnit);
}
代码示例来源:origin: advantageous/qbit
};
sendQueue = queue.sendQueueWithAutoFlush(periodicScheduler, 100, TimeUnit.MILLISECONDS);
代码示例来源:origin: advantageous/qbit
this.responseSendQueue = this.responseQueue.sendQueueWithAutoFlush(100, TimeUnit.MILLISECONDS);
this.service = service;
this.serviceMethodHandler = serviceMethodHandler;
代码示例来源:origin: advantageous/qbit
@Test
public void testSendConsume3() throws Exception {
personSendQueue = personQueue.sendQueueWithAutoFlush(10, TimeUnit.MILLISECONDS);
personSendQueue.sendMany(new Person("Geoff"), new Person("Rick"));
final Person geoff = personReceiveQueue.take();
final Person rick = personReceiveQueue.take();
assertEquals("Geoff", geoff.name);
assertEquals("Rick", rick.name);
}
代码示例来源:origin: com.github.advantageous/qbit-core
/**
* Create a wrapper SendQueue that encoders the objects to JSON
* before putting them into the queue.
* @param interval interval
* @param timeUnit timeUnit
* @return returns wrapped SendQueue tht does JSON encoding.
*/
@Override
public SendQueue<T> sendQueueWithAutoFlush(int interval, TimeUnit timeUnit) {
final SendQueue<String> sendQueue = queue.sendQueueWithAutoFlush(interval, timeUnit);
return createJsonSendQueue(sendQueue);
}
代码示例来源:origin: advantageous/qbit
@Test
public void testSendConsume4() throws Exception {
personSendQueue = personQueue.sendQueueWithAutoFlush(QBit.factory().periodicScheduler(),
10, TimeUnit.MILLISECONDS);
personSendQueue.sendBatch(Lists.list(new Person("Geoff"), new Person("Rick")));
final Person geoff = personReceiveQueue.take();
final Person rick = personReceiveQueue.take();
assertEquals("Geoff", geoff.name);
assertEquals("Rick", rick.name);
}
代码示例来源:origin: io.advantageous.qbit/qbit-core
public <T> T createProxyWithAutoFlush(final Class<T> serviceInterface,
final PeriodicScheduler periodicScheduler,
final int interval, final TimeUnit timeUnit) {
final SendQueue<MethodCall<Object>> methodCallSendQueue =
requestQueue.sendQueueWithAutoFlush(periodicScheduler, interval, timeUnit);
methodCallSendQueue.start();
return proxy(serviceInterface, methodCallSendQueue);
}
代码示例来源:origin: com.github.advantageous/qbit-core
public <T> T createProxyWithAutoFlush(Class<T> serviceInterface, int interval, TimeUnit timeUnit) {
final SendQueue<MethodCall<Object>> methodCallSendQueue = requestQueue.sendQueueWithAutoFlush(interval, timeUnit);
methodCallSendQueue.start();
return proxy(serviceInterface, methodCallSendQueue);
}
代码示例来源:origin: com.github.advantageous/qbit-core
public <T> T createProxyWithAutoFlush(final Class<T> serviceInterface,
final PeriodicScheduler periodicScheduler,
final int interval, final TimeUnit timeUnit) {
final SendQueue<MethodCall<Object>> methodCallSendQueue =
requestQueue.sendQueueWithAutoFlush(periodicScheduler, interval, timeUnit);
methodCallSendQueue.start();
return proxy(serviceInterface, methodCallSendQueue);
}
代码示例来源:origin: io.advantageous.qbit/qbit-core
default SendQueue<T> sendQueueWithAutoFlush(final int interval, final TimeUnit timeUnit) {
PeriodicScheduler periodicScheduler = QBit.factory().periodicScheduler();
return sendQueueWithAutoFlush(periodicScheduler, interval, timeUnit);
}
代码示例来源:origin: io.advantageous.qbit/qbit-core
public WebSocketTextQueue(final WebSocket webSocket, final int batchSize, final int flushInterval, final TimeUnit timeUnit) {
this.webSocket = webSocket;
this.stringQueue = QueueBuilder.queueBuilder().setBatchSize(batchSize).setPollWait(1000).build();
final SendQueue<String> sendQueue = this.stringQueue.sendQueueWithAutoFlush(flushInterval, timeUnit);
this.webSocket.setTextMessageConsumer(sendQueue::send);
}
内容来源于网络,如有侵权,请联系作者删除!