Skip to content

Commit

Permalink
finagle-core: Deprecate the ServerBuilder pattern
Browse files Browse the repository at this point in the history
Problem / Solution

We want to remove the ServerBuilder API's but let's give folks a warning
via some deprecation annotations.

Differential Revision: https://phabricator.twitter.biz/D691414
  • Loading branch information
Bryce Anderson authored and jenkins committed Jun 21, 2021
1 parent c4a1e3c commit 386171a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ Runtime Behavior Changes
be temporarily sitting behind a toggle, `com.twitter.finagle.context.MarshalledContextLookupId`
that can be used to turn off this change. ``PHAB_ID=D665209``

Deprecations
~~~~~~~~~~~~

* finagle-core: The `ServerBuilder` pattern has been deprecated. Use the stack server pattern
instead. ``PHAB_ID=D691414``

21.5.0
------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ object ServerBuilder {
type Complete[Req, Rep] =
ServerBuilder[Req, Rep, ServerConfig.Yes, ServerConfig.Yes, ServerConfig.Yes]

@deprecated("Use the stack server pattern instead", "2021-06-21")
def apply(): ServerBuilder[Nothing, Nothing, Nothing, Nothing, Nothing] =
new ServerBuilder()

@deprecated("Use the stack server pattern instead", "2021-06-21")
def get(): ServerBuilder[Nothing, Nothing, Nothing, Nothing, Nothing] =
apply()

Expand Down Expand Up @@ -175,6 +178,7 @@ private[builder] final class ServerConfig[Req, Rep, HasCodec, HasBindTo, HasName
* @see The [[https://twitter.github.io/finagle/guide/Configuration.html user guide]]
* for information on the preferred `with`-style APIs instead.
*/
@deprecated("Use the stack server pattern instead", "2021-06-21")
class ServerBuilder[Req, Rep, HasCodec, HasBindTo, HasName] private[builder] (
private[finagle] val server: StackBasedServer[Req, Rep]) {
import ServerConfig._
Expand Down

0 comments on commit 386171a

Please sign in to comment.