T
- The type of subject info that will be provided with requests and
discards.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.
Modifier and Type | Method and Description |
---|---|
void |
onDiscard(T subject)
Called when the last peer subscribed discards the subject.
|
void |
onRequest(T subject)
Called on the initial request when the first peer makes a request.
|
void onRequest(T subject)
subject
- The subject that was requested.void onDiscard(T subject)
subject
- The subject that was discarded.Copyright © 2015 Caplin Systems.