Package org.osgi.util.pushstream
Interface QueuePolicy<T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
-
- Type Parameters:
T
- The type of the dataU
- The type of the queue
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@ConsumerType @FunctionalInterface public interface QueuePolicy<T,U extends java.util.concurrent.BlockingQueue<PushEvent<? extends T>>>
AQueuePolicy
is used to control how events should be queued in the current buffer. TheQueuePolicy
will be called when an event has arrived.- See Also:
QueuePolicyOption
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
doOffer(U queue, PushEvent<? extends T> event)
Enqueue the event and return the remaining capacity available for events
-
-
-
Method Detail
-
doOffer
void doOffer(U queue, PushEvent<? extends T> event) throws java.lang.Exception
Enqueue the event and return the remaining capacity available for events- Parameters:
queue
-event
-- Throws:
java.lang.Exception
- If an error occurred adding the event to the queue. This exception will cause the connection between thePushEventSource
and thePushEventConsumer
to be closed with anPushEvent.EventType.ERROR
-
-