From 6c438132d304f74ec51b723c7553847d2fc947f3 Mon Sep 17 00:00:00 2001 From: Jonathan Ostrander Date: Tue, 5 May 2020 21:52:54 -0400 Subject: [PATCH] Add useful default custom receive functions Instead of defining the default CustomReceiveFunctions as an empty partial function, this uses the existing partial function defined in `ValueDecoder` as a default. --- src/main/scala/com/twitter/finagle/Postgres.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/com/twitter/finagle/Postgres.scala b/src/main/scala/com/twitter/finagle/Postgres.scala index 072cf6c2..34abff31 100644 --- a/src/main/scala/com/twitter/finagle/Postgres.scala +++ b/src/main/scala/com/twitter/finagle/Postgres.scala @@ -73,7 +73,8 @@ object Postgres { param.ResponseClassifier(defaultResponseClassifier) + Retries.Policy(defaultRetryPolicy) + Monitor(PostgresDefaultMonitor) + - Allocator(UnpooledByteBufAllocator.DEFAULT) + Allocator(UnpooledByteBufAllocator.DEFAULT) + + CustomReceiveFunctions(ValueDecoder.decoders orElse { case "noop" => ValueDecoder.unknown }) private def defaultStack = StackClient.newStack[PgRequest, PgResponse] .replace(StackClient.Role.prepConn, PrepConnection)