LDEV-5260 Rewrite polling to producer-subscriber model
Till now we had "are-learners-answers-updated" polling on controller
level.
It was rewritten to following scenario:
- method which stores learner answers is aware whether answers have
changed, 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 updating
one, but in the future other ones like updating table with answer % too)
- FluxMap holds a map of tool content ID -> interested hot publisher
Flux
- the Flux checks if it is interested in the tool content ID from the
Sink
- 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 next
subscriber
- data is throttled so calls to DB are not made too often
- if all subscribers are gone, the hot publisher Flux is still active; a
timeout is added which removes it from FluxMap when there were not emits
for the given time