IAnalysisResultRequester

public interface IAnalysisResultRequester<I extends IInputUnit, A extends IAnalyzeUnit>

Interface for requesting single analysis results or updates for analysis results.

Parameters:
  • <P> – Type of parse units.
  • <A> – Type of analyze units.

Methods

get

A get(FileObject resource)
Returns:Latest analysis result for given resource, or null if there is none.

request

Observable<A> request(I input, IContext context)

Requests the analysis result for given resource. When subscribing to the returned observer, it always returns a single element; the latest analysis result, or pushes an error if an error occurred while getting it. If the analysis result is cached, the observable will immediately push it. If the analysis result has been invalidated (when it is in the process of being updated), it will be pushed when it has been updated. If there is no analysis result yet, it will request a parse result, analyze the resource in given context, and push the analysis result. The simplest way to get the analysis result is to wait for it: result = requester.request(resource, context, text).toBlocking().single();

Parameters:
  • resource – Resource to get the analysis result for.
  • context – Context in which the analysis should be performed, in case there is no analysis result for given resource.
  • text – Text which should be parsed, in case there is no parse result for given resource.
Returns:

Cold observable which pushes a single element when subscribed; the latest analysis result, or pushes an error if an error occurred while getting it.

updates

Observable<AnalysisChange<A>> updates(FileObject resource)

Returns an observable that pushes analysis result updates to subscribers for given resource.

Parameters:
  • resource – Resource to push updates for.
Returns:

Hot observable that pushes updates to subscribers for given resource.