Buffer Trigger

A buffer with trigger

Лицензия

Лицензия

The Artistic License 2.0
Категории

Категории

Ant Компиляция и сборка
Группа

Группа

com.github.phantomthief
Идентификатор

Идентификатор

buffer-trigger
Последняя версия

Последняя версия

0.2.19
Дата

Дата

Тип

Тип

jar
Описание

Описание

Buffer Trigger
A buffer with trigger
Ссылка на сайт

Ссылка на сайт

https://github.com/PhantomThief/buffer-trigger
Система контроля версий

Система контроля версий

https://github.com/PhantomThief/buffer-trigger.git

Скачать buffer-trigger

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.phantomthief/buffer-trigger/ -->
<dependency>
    <groupId>com.github.phantomthief</groupId>
    <artifactId>buffer-trigger</artifactId>
    <version>0.2.19</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.phantomthief/buffer-trigger/
implementation 'com.github.phantomthief:buffer-trigger:0.2.19'
// https://jarcasting.com/artifacts/com.github.phantomthief/buffer-trigger/
implementation ("com.github.phantomthief:buffer-trigger:0.2.19")
'com.github.phantomthief:buffer-trigger:jar:0.2.19'
<dependency org="com.github.phantomthief" name="buffer-trigger" rev="0.2.19">
  <artifact name="buffer-trigger" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.phantomthief', module='buffer-trigger', version='0.2.19')
)
libraryDependencies += "com.github.phantomthief" % "buffer-trigger" % "0.2.19"
[com.github.phantomthief/buffer-trigger "0.2.19"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-api jar 1.7.21
com.google.guava : guava jar 28.1-jre
com.github.phantomthief : more-lambdas jar 0.1.36
com.google.code.findbugs : jsr305 Необязательный jar 3.0.2

test (3)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter-api jar
org.junit.jupiter : junit-jupiter-engine jar
ch.qos.logback : logback-classic jar 1.1.8

Модули Проекта

Данный проект не имеет модулей.

buffer-trigger

Build Status Coverage Status Total alerts Language grade: Java Maven Central

A local data buffer with customizable data trigger

  • customize trigger strategy
  • buffer container can be customized
  • jdk1.8 only

Usage

// declare
BufferTrigger<String> buffer = SimpleBufferTrigger.<String, Set<String>> newBuilder()
        .triggerStrategy(new MultiIntervalTriggerStrategy()
            .on(10, SECONDS, 1)
            .on(5, SECONDS, 10)
            .on(1, SECONDS, 100)
        )
        .consumer(this::out)
        .setContainer(ConcurrentSkipListSet::new, Set::add) // default is Collections.newSetFromMap(new ConcurrentHashMap<>())
        .build();
        
// enqueue
buffer.enqueue("i'm ok");

// consumer declare
private void out(Collection<String> set) {
	set.forEach(System.out::println);
}

// batch consumer blocking queue
BufferTrigger<String> buffer = BatchConsumeBlockingQueueTrigger.<String> newBuilder()
                .batchSize(3)
                .setConsumerEx(this::out)
                .bufferSize(5)
                .linger(ofSeconds(2))
                .build();
    

Special Thanks

perlmonk with his great team gives me a huge help. (https://github.com/aloha-app)

Версии библиотеки

Версия
0.2.19
0.2.18
0.2.17
0.2.15
0.2.14
0.2.13
0.2.12
0.2.11
0.2.10
0.2.9
0.2.8
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0