Skip to content

Commit

Permalink
non-recycling pool in Jackson (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning authored Nov 9, 2024
1 parent bb0b5ea commit bcaa654
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pekko-http-jackson/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ pekko-http-json {
# https://javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.18.0/com/fasterxml/jackson/core/util/JsonRecyclerPools.html
# The default is "thread-local" which is the same as the default in Jackson 2.16.
buffer-recycler {
# the supported values are "thread-local", "lock-free", "shared-lock-free", "concurrent-deque",
# "shared-concurrent-deque", "bounded"
# the supported values are "thread-local", "concurrent-deque", "shared-concurrent-deque", "bounded", "non-recycling"
# "lock-free", "shared-lock-free" are supported but not recommended as they are due for removal in Jackson
pool-instance = "thread-local"
# the maximum size of bounded recycler pools - must be >=1 or an IllegalArgumentException will occur
# only applies to pool-instance type "bounded"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ object JacksonSupport extends JacksonSupport {
case "shared-concurrent-deque" => JsonRecyclerPools.sharedConcurrentDequePool()
case "bounded" =>
JsonRecyclerPools.newBoundedPool(cfg.getInt("buffer-recycler.bounded-pool-size"))
case "non-recycling" => JsonRecyclerPools.nonRecyclingPool()
case other => throw new IllegalArgumentException(s"Unknown recycler-pool: $other")
}

Expand Down

0 comments on commit bcaa654

Please sign in to comment.