Interface SharedInformer<T>
- All Known Subinterfaces:
SharedIndexInformer<T>
- All Known Implementing Classes:
DefaultSharedIndexInformer
public interface SharedInformer<T>
SharedInformer defines basic methods of an informer.
This has been ported from official go client: https://github.com/kubernetes/client-go/blob/master/tools/cache/shared_informer.go
-
Method Summary
Modifier and Type Method Description voidaddEventHandler(ResourceEventHandler<T> handler)Add event handlervoidaddEventHandlerWithResyncPeriod(ResourceEventHandler<T> handle, long resyncPeriod)Adds an event handler to the shared informer using the specified resync period.booleanhasSynced()StringlastSyncResourceVersion()The resource version observed when last synced with the underlying store.voidrun()Starts the shared informer, which will be stopped until stop() is called.voidstop()Stops the shared informer.
-
Method Details
-
addEventHandler
Add event handler- Parameters:
handler- event handler
-
addEventHandlerWithResyncPeriod
Adds an event handler to the shared informer using the specified resync period. Events to a single handler are delivered sequentially, but there is no coordination between different handlers.- Parameters:
handle- the event handlerresyncPeriod- the specific resync period
-
run
void run()Starts the shared informer, which will be stopped until stop() is called. -
stop
void stop()Stops the shared informer. -
hasSynced
boolean hasSynced() -
lastSyncResourceVersion
String lastSyncResourceVersion()The resource version observed when last synced with the underlying store. The value returned is not synchronized with access to the underlying store and is not thread-safe.- Returns:
- string value
-