org.jetlang.channels
Class LastSubscriber<T>
java.lang.Object
org.jetlang.channels.BaseSubscription<T>
org.jetlang.channels.LastSubscriber<T>
- All Implemented Interfaces:
- Subscribable<T>, Callback<T>
public class LastSubscriber<T>
- extends BaseSubscription<T>
Subscribes to last event received on the channel. If consuming thread cannot
process events as fast as they arrive, then older events will be dropped in favor
of most recent. Flush interval determines rate at which events are processes. If interval is less than 1, then
events will be delivered as fast as consuming thread can handle them.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LastSubscriber
public LastSubscriber(Fiber context,
Callback<T> target,
Filter<T> filter,
int flushInterval,
java.util.concurrent.TimeUnit timeUnit)
LastSubscriber
public LastSubscriber(Fiber context,
Callback<T> target,
int flushInterval,
java.util.concurrent.TimeUnit timeUnit)
onMessageOnProducerThread
protected void onMessageOnProducerThread(T msg)
- Specified by:
onMessageOnProducerThread
in class BaseSubscription<T>
Copyright © 2009. All Rights Reserved.