Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Activity api offer asynchronous processing option #760

Merged

Conversation

symphony-soufiane
Copy link
Contributor

@symphony-soufiane symphony-soufiane commented Apr 18, 2023

Description

Activity api, not being asynchronous, leads to a blocking issue where a command takes long time to get processed and blocks all incoming commands. In this PR, we make the activity api support asynchronous processing. This is reached by passing a new option asynchronous to the slash annotation. In this case, an executor service is used to provide a separate thread to process the command and leaves the main thread free to receive new commands.

The executor service uses "newCachedThreadPool" to avoid creating a new thread pool for each command as it will reuse the previously finished ones. The number of threads is unbounded by using this constructor. A factory ThreadFactoyBuilder is introduced to isolate the threads creation from the core code of AbstractActivity.

@symphony-soufiane symphony-soufiane merged commit 3249074 into finos:main Apr 20, 2023
4 checks passed
@symphony-soufiane symphony-soufiane deleted the asynchronous-activity-api branch April 20, 2023 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants