LDEV-5260 Rewrite polling to producer-subscriber model Till now we had "are-learners-answers-updated" polling on controller level. It was re…
Show more
LDEV-5260 Rewrite polling to producer-subscriber modelTill now we had "are-learners-answers-updated" polling on controllerlevel.It was rewritten to following scenario:- method which stores learner answers is aware whether answers havechanged, i.e. it knows if charts need to be updated- it flushes latest data to DB and puts tool content ID to Sink- Sink notifies all interested Fluxes (currently only charts updatingone, but in the future other ones like updating table with answer % too)- FluxMap holds a map of tool content ID -> interested hot publisherFlux- the Flux checks if it is interested in the tool content ID from theSink- if so, it fetches data from DB and emits it to all subscribers, i.e.opened monitoring windows with charts displayed- data is cached so it is immediately available on for the nextsubscriber- data is throttled so calls to DB are not made too often- if all subscribers are gone, the hot publisher Flux is still active; atimeout is added which removes it from FluxMap when there were not emitsfor the given time
Show less