You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/src/main/scala/execution.scala
+53-5Lines changed: 53 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -14,21 +14,70 @@ case class Http(
14
14
) extendsHttpExecutor {
15
15
importAsyncHttpClientConfig.Builder
16
16
17
-
/** Replaces `client` with a new instance configured using the withBuilder
18
-
function. The current client config is the builder's prototype. */
19
-
defconfigure(withBuilder: Builder=>Builder) =
17
+
/**
18
+
* Returns a new instance replacing the underlying `client` with a new instance that is configured
19
+
* using the `withBuilder` provided. The current client config is the builder's prototype.
20
+
*
21
+
* As of Dispatch 0.12.2, it is recommended that you use [[closeAndConfigure]] instead to prevent
22
+
* the automatic resource link that using this method will cause. However, if you expect to be
23
+
* able to ''continue'' using this Http instance after
24
+
*
25
+
* In Dispatch 0.13.x, this will be changed such that it only causes a resource link if you've
26
+
* actually used the Http client, but the method is still deprecated and is one that we're
27
+
* planning to remove. If you need this functionality in the long term, it is recommended that you
28
+
* change your code to invoke the `.copy` method on the `Http` case class directly.
29
+
*/
30
+
@deprecated("This method is deprecated and will be removed in a future version of dispatch. This method is known to cause a resource leak in Dispatch 0.12.x. If you don't need to continue using the original Http instance after invoking this, you should switch to using closeAndConfigure.", "0.12.2")
/** Singleton default Http executor, can be used directly or altered
28
57
* with its case-class `copy` */
29
58
objectHttpextendsHttp(
30
59
InternalDefaults.client
31
-
)
60
+
) {
61
+
/**
62
+
* The default executor. Invoking this val will shutdown the client created by the Http singleton.
63
+
*/
64
+
lazyvaldefault= {
65
+
this.closeAndConfigure(builder => builder)
66
+
}
67
+
68
+
@deprecated("Using the Http singleton directly is deprecated and will be removed in a future version of dispatch. Please switch to invoking Http.default for using a globally accessible default Http client.", "0.12.2")
@deprecated("Using the Http singleton directly is deprecated and will be removed in a future version of dispatch. Please switch to invoking Http.default for using a globally accessible default Http client.", "0.12.2")
@deprecated("Using the Http singleton directly is deprecated and will be removed in a future version of dispatch. Please switch to invoking Http.default for using a globally accessible default Http client.", "0.12.2")
0 commit comments