IParseResultRequester<I extends IInputUnit, P extends IParseUnit>¶
Interface for requesting single parse results or updates for parse results.
Requests the parse result for given resource. When subscribing to the returned observer, it always returns a single element; the latest parse result, or pushes an error if an error occurred while getting it. If the parse result is cached, the observable will immediately push it. If the parse 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 parse result yet, it will parse with given text and push the parse result. The simplest way to get the parse result is to wait for it:
result = requester.request(resource, language, text).toBlocking().single();
- resource – Resource to get the parse result for.
- language – Language given text should be parsed with, in case there is no parse result for given resource.
- text – Text which should be parsed, in case there is no parse result for given resource.
Cold observable which pushes a single element when subscribed; the latest parse result, or pushes an error if an error occurred while getting it.