本文整理了Java中io.advantageous.qbit.queue.Queue.startListener
方法的一些代码示例,展示了Queue.startListener
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Queue.startListener
方法的具体详情如下:
包路径:io.advantageous.qbit.queue.Queue
类名称:Queue
方法名:startListener
[英]This starts up a listener which will listen to items on the receive queue. It will notify when the queue is empty, when the queue is idle, when the queue is shutdown, etc.
An idle queue is an indication that it is a good time to do periodic cleanup, etc.
[中]这将启动一个侦听器,该侦听器将侦听接收队列中的项目。它将在队列为空、队列空闲、队列关闭等情况下发出通知。
空闲队列表示这是进行定期清理等的好时机。
代码示例来源:origin: advantageous/qbit
public void startReturnHandlerProcessor(ReceiveQueueListener<Response<Object>> listener) {
responseQueue.startListener(listener);
}
代码示例来源:origin: advantageous/qbit
public void startWebResponseReturnHandler(ReceiveQueueListener<Response<Object>> listener) {
webResponseQueue.startListener(listener);
}
代码示例来源:origin: advantageous/qbit
@Override
public void startListener(ReceiveQueueListener<String> listener) {
stringQueue.startListener(listener);
}
代码示例来源:origin: advantageous/qbit
methodQueue.startListener(new ReceiveQueueListener<MethodCall<Object>>() {
代码示例来源:origin: advantageous/qbit
/**
* Start listener. Once this is called messages can come in on a foreign thread.
*/
public void start() {
if (!queue.isPresent()) {
initQueue();
}
queue.ifPresent(actualQueue -> actualQueue.startListener(EventBusQueueAdapter.this::sendToEventManager));
}
代码示例来源:origin: advantageous/qbit
/**
* Start a listener.
*
* @param listener listener
*/
@Override
public void startListener(final ReceiveQueueListener<T> listener) {
queue.startListener(item -> listener.receive(fromJsonFunction.apply(item)));
}
代码示例来源:origin: advantageous/qbit
/**
* Handles responses coming back from services.
*
* @param responseQueue response queue
*/
@Override
public void startReturnHandlerProcessor(final Queue<Response<Object>> responseQueue) {
//noinspection Convert2MethodRef
responseQueue.startListener(response -> handleResponse(response));
}
代码示例来源:origin: advantageous/qbit
@Override
public void start() {
messages.startListener(new ReceiveQueueListener<WebSocketMessage>() {
@Override
public void receive(WebSocketMessage item) {
webSocketMessageConsumer.accept(item);
}
@Override
public void empty() {
}
@Override
public void limit() {
}
@Override
public void shutdown() {
}
@Override
public void idle() {
}
});
}
代码示例来源:origin: advantageous/qbit
responseQueue.startListener(new ReceiveQueueListener<Response<Object>>() {
代码示例来源:origin: advantageous/qbit
requestQueue.startListener(new ReceiveQueueListener<MethodCall<Object>>() {
代码示例来源:origin: io.advantageous.qbit/qbit-core
public void startWebResponseReturnHandler(ReceiveQueueListener<Response<Object>> listener) {
webResponseQueue.startListener(listener);
}
代码示例来源:origin: advantageous/qbit
@Test
public void testSendConsume8() throws Exception {
final List<Person> list = Lists.list(new Person("Geoff"), new Person("Rick"));
Iterable<Person> persons = () -> list.iterator();
personSendQueue.sendBatch(persons);
personSendQueue.flushSends();
ArrayBlockingQueue<Person> personsABQ = new ArrayBlockingQueue<>(100);
personQueue.startListener(item -> personsABQ.add(item));
while (personsABQ.size() != 2) {
Sys.sleep(1);
}
final Person geoff = personsABQ.poll();
final Person rick = personsABQ.poll();
assertEquals("Geoff", geoff.name);
assertEquals("Rick", rick.name);
}
代码示例来源:origin: advantageous/qbit
queue.startListener(item -> {
count.decrementAndGet();
if (count.get() == 0) {
代码示例来源:origin: io.advantageous.qbit/qbit-core
/**
* Start listener. Once this is called messages can come in on a foreign thread.
*/
public void start() {
if (!queue.isPresent()) {
initQueue();
}
queue.ifPresent(actualQueue -> actualQueue.startListener(EventBusQueueAdapter.this::sendToEventManager));
}
代码示例来源:origin: com.github.advantageous/qbit-core
/**
* Handles responses coming back from services.
*
* @param responseQueue response queue
*/
@Override
public void startReturnHandlerProcessor(final Queue<Response<Object>> responseQueue) {
//noinspection Convert2MethodRef
responseQueue.startListener(response -> handleResponse(response));
}
代码示例来源:origin: io.advantageous.qbit/qbit-core
/**
* Start a listener.
*
* @param listener listener
*/
@Override
public void startListener(final ReceiveQueueListener<T> listener) {
queue.startListener(item -> listener.receive(fromJsonFunction.apply(item)));
}
代码示例来源:origin: com.github.advantageous/qbit-core
/**
* Start a listener.
* @param listener listener
*/
@Override
public void startListener(final ReceiveQueueListener<T> listener) {
queue.startListener(item -> listener.receive(fromJsonFunction.apply(item)));
}
代码示例来源:origin: io.advantageous.qbit/qbit-core
/**
* Handles responses coming back from services.
*
* @param responseQueue response queue
*/
@Override
public void startReturnHandlerProcessor(final Queue<Response<Object>> responseQueue) {
//noinspection Convert2MethodRef
responseQueue.startListener(response -> handleResponse(response));
}
代码示例来源:origin: com.github.advantageous/qbit-core
/**
* Start listener. Once this is called messages can come in on a foreign thread.
*/
public void start() {
if (!queue.isPresent()) {
initQueue();
}
queue.ifPresent(actualQueue -> actualQueue.startListener(EventBusQueueAdapter.this::sendToEventManager));
}
代码示例来源:origin: advantageous/qbit
queue.startListener(new ReceiveQueueListener<String>() {
@Override
public void receive(String item) {
内容来源于网络,如有侵权,请联系作者删除!