A trait to ensure some set of closeable resources are closed in the event of a throwable occuring during a request.
A trait to ensure some set of closeable resources are closed in the event of a throwable occuring during a request. This can be combined with other AsyncHandlers, for example the OkHandler provided by Dispatch, to ensure that any closeable resources are cleanly shut down in the event of an exception.
See the implementation of dispatch.as.File for an example of how this is used.
Type alias to scala.concurrent.Future so you don't have to import
Http executor with defaults
URI representation with raw parts, so
This wrapper provides referential transparency for the underlying RequestBuilder.
Builds tuples of (Request, AsyncHandler) for passing to Http#apply.
Builds tuples of (Request, AsyncHandler) for passing to Http#apply. Implied in dispatch package object
Type alias for Response, avoid need to import
Type alias for URI, avoid need to import
Singleton helper for vending Http instances.
Singleton helper for vending Http instances.
In past versions of Dispatch, this singleon was, itself, an Http executor. That could lead to
a few code traps were it was possible to unintentionally allocate additional Http pools without
realizing it because Http.xxxx
and Http().xxxx
both look very similar - yet do very different
things.
In the interest of avoiding such code traps in future releases of Dispatch, Http
was changed
to a helper in 0.13.x that is capable of vending a default Http
executor instance or
of configuring a custom one with its withConfiguration
method.
If you relied on the default Http
instance in your code you can easily port
your code to 0.13.x by simply invoking the Http.default
method. Such as...
Http.default(localhost / "split" << Seq("str" -> str) > as.String)