|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Enqueue predicates allow users to specify a method that will 'screen' elements being enqueued onto a sink, either accepting or rejecting them. This mechanism can be used to implement many interesting load-conditioning policies, for example, simple thresholding, rate control, credit-based flow control, and so forth. Note that the enqueue predicate runs in the context of the caller of enqueue(), which means it must be simple and fast.
| Method Summary | |
boolean |
accept(java.lang.Object[] elements,
Sink modifyingSink)
Tests the given element for acceptance onto the m_sink. |
boolean |
accept(java.lang.Object element,
Sink modifyingSink)
Tests the given element for acceptance onto the m_sink. |
| Method Detail |
public boolean accept(java.lang.Object element,
Sink modifyingSink)
element - The element to enqueuemodifyingSink - The sink that is used for this predicate
true if the sink accepts the element;
false otherwise.
public boolean accept(java.lang.Object[] elements,
Sink modifyingSink)
elements - The array of elements to enqueuemodifyingSink - The sink that is used for this predicate
true if the sink accepts all the elements;
false otherwise.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||