T- a type of Kubernetes resource
@Immutable @ThreadSafe public final class EventDistributor<T extends HasMetadata> extends ResourceTrackingEventQueueConsumer<T> implements AutoCloseable
ResourceTrackingEventQueueConsumerthat consumes EventQueue instances by feeding each
EventQueuebeing consumed to
AbstractEvents that have been registered.
|Constructor and Description|
Creates a new
|Modifier and Type||Method and Description|
Releases resources held by this
accept, createEvent, createLogger, createSynchronizationEvent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public EventDistributor(Map<Object,T> knownObjects)
knownObjects- a mutable
Mapof Kubernetes resources that contains or will contain Kubernetes resources known to this
EventDistributorand whatever mechanism (such as a
Controller) is feeding it; may be
public final void addConsumer(Consumer<? super AbstractEvent<? extends T>> consumer)
EventDistributoras a listener that will be notified of each
public final void removeConsumer(Consumer<? super AbstractEvent<? extends T>> consumer)
public final void close()
EventDistributorduring its execution.
public final boolean shouldSynchronize()
EventDistributorshould synchronize with its upstream source.
tools/cache package spreads
synchronization out among the reflector, controller, event cache
and event processor constructs for no seemingly good reason.
They should probably be consolidated, particularly in an
object-oriented environment such as Java.
trueif synchronization should occur;
protected final void accept(AbstractEvent<? extends T> event)
AbstractEventby forwarding it to the
Consumer.accept(Object)method of each
Consumerregistered with this
Copyright © 2017–2018, microBean. All rights reserved.