subscribeTo

abstract fun subscribeTo(prompt: LegalProcessor.Input.Prompt, requestUpdate: LegalProcessor.Input.RequestUpdate, onResult: Consumer<LegalProcessor.Input.Result>): Closeable

Subscribes to the provided onResult to be notified when a new Result is available for this input. The subscriber specifies a Prompt that must be taken into account when presenting a UI or calling back with a previously saved user response for the provided unique Prompt.id. Even though a saved user response may exist for a specific Prompt.id when the requestUpdate option is RequestUpdate.ALWAYS it is expected that the underlying LegalProcessor.Input implementation will re-prompt user to get a new response. The returned Closeable must be closed when done working with this input otherwise underlying resources will be leaked.