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

Move blocking handleMessageEvent to executer thread to keep pipeline reactive #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Arooba-git
Copy link

Hi! 👋
Apparently channelRead in BridgeRuntime is blocking the main thread (as detected by blockhound):
Screen Shot 2023-07-16 at 12 42 30 AM

This PR fixes the blocking so that the pipeline remain reactive end-to-end.

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Do not use *

@@ -123,6 +118,7 @@
@Sharable
public class BridgeRuntime extends HttpStaticFileServerHandler {

private final ExecutorService executor = Executors.newSingleThreadExecutor();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make this optional, and the Thread pool configuration and optional. Making it the default change the current behaviour, and we will have to bump to a major version 4.0.0

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.

2 participants