He-Pin commented on code in PR #519:
URL: https://github.com/apache/pekko-http/pull/519#discussion_r1541552588


##########
http-marshallers-java/http-jackson/src/main/java/org/apache/pekko/http/javadsl/marshallers/jackson/Jackson.java:
##########
@@ -113,7 +116,28 @@ static ObjectMapper createMapper(final Config config) {
         JsonFactory.builder()
             .streamReadConstraints(streamReadConstraints)
             .streamWriteConstraints(streamWriteConstraints)
+            .recyclerPool(getBufferRecyclerPool(config))
             .build();
     return new JsonMapper(jsonFactory);
   }
+
+  private static RecyclerPool<BufferRecycler> getBufferRecyclerPool(final 
Config cfg) {
+    switch (cfg.getString("buffer-recycler.pool-instance")) {
+      case "thread-local":
+        return JsonRecyclerPools.threadLocalPool();
+      case "lock-free":
+        return JsonRecyclerPools.newLockFreePool();
+      case "shared-lock-free":
+        return JsonRecyclerPools.sharedLockFreePool();
+      case "concurrent-deque":
+        return JsonRecyclerPools.newConcurrentDequePool();
+      case "shared-concurrent-deque":
+        return JsonRecyclerPools.sharedConcurrentDequePool();
+      case "bounded":
+        return 
JsonRecyclerPools.newBoundedPool(cfg.getInt("buffer-recycler.bounded-pool-size"));
+      default:
+        throw new IllegalArgumentException(
+            "Unknown recycler-pool: " + 
cfg.getString("buffer-recycler.pool-instance"));

Review Comment:
   I mean it is been used here too



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to