org.jetlang.channels.KeyedBatchSubscriber Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jetlang Show documentation
Show all versions of jetlang Show documentation
Jetlang provides a high performance java threading library. It is a complement to the java.util.concurrent
package introduced in 1.5 and should be used for message based concurrency similar to event based actors in
Scala.
package org.jetlang.channels;
import org.jetlang.core.Callback;
import org.jetlang.core.Filter;
import org.jetlang.fibers.Fiber;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* Channel subscription that drops duplicates based upon a key.
*/
public class KeyedBatchSubscriber extends BaseSubscription {
private final Object _batchLock = new Object();
private final Fiber _context;
private final Callback