Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

ConversationWebservice Analysis with parsed callback is not Async #292

Closed
westei opened this issue Sep 28, 2018 · 1 comment
Closed

ConversationWebservice Analysis with parsed callback is not Async #292

westei opened this issue Sep 28, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@westei
Copy link
Member

westei commented Sep 28, 2018

Expected Behaviour

If a Callback is parsed in the ConversationWebservice the Analysis is expected to be done async to request.

Actual Behaviour

The ConversationWebservice only returns after the Analysis is completed

Steps to Reproduce

The best way to demonstrate this is to configure a Callback URL that times out, as in this case the Request to the ConversationWebservice will also time out.

Environment

  • Smarti-Version: any 0.7.* release
@westei westei added this to the v0.8.0 milestone Sep 28, 2018
@westei westei self-assigned this Sep 28, 2018
@westei
Copy link
Member Author

westei commented Sep 28, 2018

It turns out the reason is the usage of CompleteableFuture#whenComplete to send the callback.

CompleteableFuture#whenComplete is executed in the callers thread context. So the Request to the ConversationWebservice is synced with (waits for the comlpetion of) the async Analysis to send the Callback in the Thread Context of the ConversationWebserivce Request

Changing the CompleteableFuture#whenComplete calls to CompleteableFuture#whenCompleteAsync will ensure the expected behaviour as this will use the Suppliers Thread Context for the execution of the Callback

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant