File tree Expand file tree Collapse file tree
src/main/java/io/github/easy4j/codex/appserver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public class CodexAppServerClient implements AutoCloseable {
7777 private final CodexAppServerConfig config ;
7878 private final ObjectMapper objectMapper =
7979 JsonMapper .builder ().disable (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES ).build ();
80- private final ThreadMappingCache threadBySession ;
80+ private final ThreadMappingStore threadBySession ;
8181 private final SessionExecutionCoordinator sessionCoordinator = new SessionExecutionCoordinator ();
8282 private final Object httpClientLock = new Object ();
8383 private final ExecutorService clientExecutor = Executors .newCachedThreadPool (r -> {
@@ -96,8 +96,15 @@ public class CodexAppServerClient implements AutoCloseable {
9696 * @throws NullPointerException if {@code config} is {@code null}.
9797 */
9898 public CodexAppServerClient (CodexAppServerConfig config ) {
99+ this (config , new ThreadMappingCache (
100+ Objects .requireNonNull (config , "config" ).getMaxSessionMappings ()));
101+ }
102+
103+ public CodexAppServerClient (
104+ CodexAppServerConfig config ,
105+ ThreadMappingStore threadMappingStore ) {
99106 this .config = Objects .requireNonNull (config , "config" );
100- this .threadBySession = new ThreadMappingCache ( config . getMaxSessionMappings () );
107+ this .threadBySession = Objects . requireNonNull ( threadMappingStore , "threadMappingStore" );
101108 }
102109
103110 /**
You can’t perform that action at this time.
0 commit comments