- Type Parameters:
T- The type of subject info that will be provided with requests and discards.
- All Known Implementing Classes:
public interface CachedDataProvider<T extends SubjectInfo>
A DataProvider which receives a single
onRequest(SubjectInfo)and a single
onDiscard(SubjectInfo), even if requests are made from multiple peers. A cache is kept for subscriptions and also records so that any subsequent peer request after an initial request will receive the current state of the message before another update is sent.
In conjunction with a
SubjectParser, each request and discard will be provided a parsed object that represents the subject.
void onRequest(T subject)Called on the initial request when the first peer makes a request.
subject- The subject that was requested.
void onDiscard(T subject)Called when the last peer subscribed discards the subject.
subject- The subject that was discarded.