You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: We want to show variable values in the Variables View as the user steps through the code.
21
23
22
-
-**Asynchronous**
23
-
- When the user steps through the program, the debugger needs to **fetch variable values** from the target (like a remote system). This operation might **take a few milliseconds or more**, depending on the connection. If we **block the UI thread, the UI freezes**.
24
+
### 1.1.**Asynchronous**
25
+
-Req: When the user steps through the program, the debugger needs to **fetch variable values** from the target (like a remote system). This operation might **take a few milliseconds or more**, depending on the connection. If we **block the UI thread, the UI freezes**.
24
26
- Solution: Use an asynchronous method to fetch variable data
- Allows the Eclipse debug framework to continue updating other views.
40
42
41
-
-**Synchronous**
42
-
- We want to implement a feature like “evaluate expression” that requires the value immediately. We don’t want to rewrite your entire logic using async callbacks just to get the result of getVariableValue().
43
+
### 1.2.**Synchronous**
44
+
- We want to implement a feature like **evaluate expression** that requires the value immediately. We don’t want to rewrite your entire logic using async callbacks just to get the result of getVariableValue().
43
45
44
-
- Solution: Use a DSF Query to wrap the async call in a synchronous interface:
46
+
- Solution: Use a DSF Query to **wrap the async call in a synchronous interface**:
-`Async methods is a way that use a callback object to indicate their completion`.
83
+
84
+
## 2.1. Request Monitor
85
+
- There is an standard **callback object** used in DSF, the request monitor, has following features:
86
+
-**Executor**: executor to invoke the callback method
87
+
-**Status**: indicating the success or failure of the callback method
88
+
-**Callback methods**: methods which are invoked when the callback is invoked: handleCompleted(), handleOK(), handleError(),... -> overwrite these if need to perform additional process after async method completion.
89
+
-**Parent request monitor**:
84
90
- Returning values to the caller. ( Data Request Monitor)
85
91
- Done count. (Multi-Request Monitor)
86
92
87
-
- Examples:
93
+
## 2.2. Data Request Monitor
94
+
- The **Request Monitor** can return status of the async method but do not return a value to caller. **Data Request Monitor** can be used for that purpose.
95
+
96
+
## 2.3. Counting Request Monitor
97
+
- When we need to manage the completion of several request monitor. It is configured such that it's done() method needs to be called a count number of times before the callback method is invoked.
98
+
99
+
## 2.4 Examples:
88
100
```java
89
101
importjava.util.concurrent.Executor;
90
102
@@ -98,15 +110,15 @@ public class Test {
98
110
Executor executor =ImmediateExecutor.getInstance(); // Get the Executor
0 commit comments