mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
PY-75515 Refactoring: move duplicated code to inner class
GitOrigin-RevId: b27150a87929cfdd271d8d6b4fd017d39df1dd61
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dc4b3eccd4
commit
7f498ca2c8
@@ -48,6 +48,18 @@ public class ClientModeMultiProcessDebugger implements ProcessDebugger {
|
|||||||
|
|
||||||
private final @NotNull ExecutorService myExecutor;
|
private final @NotNull ExecutorService myExecutor;
|
||||||
|
|
||||||
|
private class ConnectToDebuggerTask implements Runnable {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
tryToConnectRemoteDebugger();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
LOG.info(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ClientModeMultiProcessDebugger(@NotNull final IPyDebugProcess debugProcess,
|
public ClientModeMultiProcessDebugger(@NotNull final IPyDebugProcess debugProcess,
|
||||||
@NotNull String host, int port) {
|
@NotNull String host, int port) {
|
||||||
myDebugProcess = debugProcess;
|
myDebugProcess = debugProcess;
|
||||||
@@ -58,16 +70,7 @@ public class ClientModeMultiProcessDebugger implements ProcessDebugger {
|
|||||||
|
|
||||||
myExecutor = ConcurrencyUtil.newSingleThreadExecutor(connectionThreadsName);
|
myExecutor = ConcurrencyUtil.newSingleThreadExecutor(connectionThreadsName);
|
||||||
|
|
||||||
Runnable task = () -> {
|
myExecutor.execute(new ConnectToDebuggerTask());
|
||||||
try {
|
|
||||||
tryToConnectRemoteDebugger();
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
LOG.info(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
myExecutor.execute(task);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -87,14 +90,7 @@ public class ClientModeMultiProcessDebugger implements ProcessDebugger {
|
|||||||
try {
|
try {
|
||||||
ProcessCreatedMsgReceivedCommand command = new ProcessCreatedMsgReceivedCommand(this, commandSequence);
|
ProcessCreatedMsgReceivedCommand command = new ProcessCreatedMsgReceivedCommand(this, commandSequence);
|
||||||
command.execute();
|
command.execute();
|
||||||
myExecutor.execute(() -> {
|
myExecutor.execute(new ConnectToDebuggerTask());
|
||||||
try {
|
|
||||||
tryToConnectRemoteDebugger();
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
LOG.info(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
catch (PyDebuggerException e) {
|
catch (PyDebuggerException e) {
|
||||||
LOG.info(e);
|
LOG.info(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user