Time-aware set implementations. Can be used to implement throttles with quiet period.
Say you have a queue, producer, and consumer. The producer is quick but with uneven pace. Messages it produces can repeat, and do come in groups. The consumer though is interested only in unique messages. Also if there are two or more repeated messages in quick succession, the consumer should only act once.
In other words: the consumer wants elements that are now in their quiet period.
Only SLF4J but used very sparingly.
<dependency> <groupId>pl.essekkat</groupId> <artifactId>asparagus</artifactId> <version>1.2.1</version> </dependency>
Asparagus<String> a = new ManagedTimedAsparagus<>(50); a.add("a"); a.add("b"); Thread.sleep(51); a.size() == 2;
ManagedTimedAsparagus can call function(s) after successful promotions. Look into pl.essekkat.asparagus.thread.ThreadedTest.callback.
Please use GitHub Issues.
- Overflow controls
- Persistent store for queues
- Inter-JVM synchronization (JGroups?)
- More tests