Skip to content

Commit 296ccac

Browse files
committed
On branch edburns/dd-2758695-virtual-threads-accept-executor
modified: README.md - Use the "uncomment these three lines to get Virtual Threads" approach modified: src/main/java/com/github/copilot/sdk/json/CopilotClientOptions.java - Cleanup. Sorting. Signed-off-by: Ed Burns <edburns@microsoft.com>
1 parent 39df3db commit 296ccac

File tree

2 files changed

+179
-172
lines changed

2 files changed

+179
-172
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,23 @@ implementation 'com.github:copilot-sdk-java:0.2.1-java.0'
6969
import com.github.copilot.sdk.CopilotClient;
7070
import com.github.copilot.sdk.events.AssistantMessageEvent;
7171
import com.github.copilot.sdk.events.SessionUsageInfoEvent;
72+
import com.github.copilot.sdk.json.CopilotClientOptions;
7273
import com.github.copilot.sdk.json.MessageOptions;
7374
import com.github.copilot.sdk.json.PermissionHandler;
7475
import com.github.copilot.sdk.json.SessionConfig;
7576

77+
import java.util.concurrent.Executors;
78+
7679
public class CopilotSDK {
7780
public static void main(String[] args) throws Exception {
7881
var lastMessage = new String[]{null};
7982

8083
// Create and start client
81-
try (var client = new CopilotClient()) {
84+
try (var client = new CopilotClient()) { // JDK 25+: comment out this line
85+
// JDK 25+: uncomment the following 3 lines for virtual thread support
86+
// var options = new CopilotClientOptions()
87+
// .setExecutor(Executors.newVirtualThreadPerTaskExecutor());
88+
// try (var client = new CopilotClient(options)) {
8289
client.start().get();
8390

8491
// Create a session

0 commit comments

Comments
 (0)