final case class Client(open: Service[Request, DisposableResponse], shutdown: Task[Unit]) extends Product with Serializable
- open
a service to asynchronously return a DisposableResponse from a Request. This is a low-level operation intended for client implementations and middleware.
- shutdown
a Task to shut down this Shutdown this client, closing any open connections and freeing resources
- Source
- Client.scala
- Alphabetic
- By Inheritance
- Client
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Client(open: Service[Request, DisposableResponse], shutdown: Task[Unit])
- open
a service to asynchronously return a DisposableResponse from a Request. This is a low-level operation intended for client implementations and middleware.
- shutdown
a Task to shut down this Shutdown this client, closing any open connections and freeing resources
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Client, B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def ensuring(cond: (Client) ⇒ Boolean, msg: ⇒ Any): Client
- def ensuring(cond: (Client) ⇒ Boolean): Client
- def ensuring(cond: Boolean, msg: ⇒ Any): Client
- def ensuring(cond: Boolean): Client
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def expect[A](req: Task[Request])(implicit d: EntityDecoder[A]): Task[A]
-
def
expect[A](s: String)(implicit d: EntityDecoder[A]): Task[A]
Submits a GET request to the URI specified by the String and decodes the response on success.
Submits a GET request to the URI specified by the String and decodes the response on success. On failure, the status code is returned. The underlying HTTP connection is closed at the completion of the decoding.
-
def
expect[A](uri: Uri)(implicit d: EntityDecoder[A]): Task[A]
Submits a GET request to the specified URI and decodes the response on success.
Submits a GET request to the specified URI and decodes the response on success. On failure, the status code is returned. The underlying HTTP connection is closed at the completion of the decoding.
-
def
expect[A](req: Request)(implicit d: EntityDecoder[A]): Task[A]
Submits a request and decodes the response on success.
Submits a request and decodes the response on success. On failure, the status code is returned. The underlying HTTP connection is closed at the completion of the decoding.
-
def
fetch[A](req: Task[Request])(f: (Response) ⇒ Task[A]): Task[A]
Submits a request, and provides a callback to process the response.
Submits a request, and provides a callback to process the response.
- req
A Task of the request to submit
- f
A callback for the response to req. The underlying HTTP connection is disposed when the returned task completes. Attempts to read the response body afterward will result in an error.
- returns
The result of applying f to the response to req
-
def
fetch[A](req: Request)(f: (Response) ⇒ Task[A]): Task[A]
Submits a request, and provides a callback to process the response.
Submits a request, and provides a callback to process the response.
- req
The request to submit
- f
A callback for the response to req. The underlying HTTP connection is disposed when the returned task completes. Attempts to read the response body afterward will result in an error.
- returns
The result of applying f to the response to req
-
def
fetchAs[A](req: Request)(implicit d: EntityDecoder[A]): Task[A]
Submits a request and decodes the response, regardless of the status code.
Submits a request and decodes the response, regardless of the status code. The underlying HTTP connection is closed at the completion of the decoding.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def formatted(fmtstr: String): String
-
def
get[A](s: String)(f: (Response) ⇒ Task[A]): Task[A]
Submits a request and decodes the response on success.
Submits a request and decodes the response on success. On failure, the status code is returned. The underlying HTTP connection is closed at the completion of the decoding.
-
def
get[A](uri: Uri)(f: (Response) ⇒ Task[A]): Task[A]
Submits a GET request, and provides a callback to process the response.
Submits a GET request, and provides a callback to process the response.
- uri
The URI to GET
- f
A callback for the response to a GET on uri. The underlying HTTP connection is disposed when the returned task completes. Attempts to read the response body afterward will result in an error.
- returns
The result of applying f to the response to req
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- val open: Service[Request, DisposableResponse]
- val shutdown: Task[Unit]
-
def
shutdownNow(): Unit
Shuts this client down, and blocks until complete.
- def streaming[A](req: Request)(f: (Response) ⇒ Process[Task, A]): Process[Task, A]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toHttpService: HttpService
Returns this client as an HttpService.
Returns this client as an HttpService. It is the responsibility of callers of this service to run the response body to dispose of the underlying HTTP connection.
This is intended for use in proxy servers.
fetch
,fetchAs
, toService, and streaming are safer alternatives, as their signatures guarantee disposal of the HTTP connection. -
def
toService[A](f: (Response) ⇒ Task[A]): Service[Request, A]
Returns this client as a Service.
Returns this client as a Service. All connections created by this service are disposed on completion of callback task f.
This method effectively reverses the arguments to
fetch
, and is preferred when an HTTP client is composed into a larger Kleisli function, or when a common response callback is used by many call sites. -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def →[B](y: B): (Client, B)
Deprecated Value Members
-
def
fetchAs[A](req: Task[Request])(implicit d: EntityDecoder[A]): Task[A]
Submits a request and decodes the response, regardless of the status code.
Submits a request and decodes the response, regardless of the status code. The underlying HTTP connection is closed at the completion of the decoding.
- Annotations
- @deprecated
- Deprecated
(Since version 0.14) Use expect
-
def
getAs[A](s: String)(implicit d: EntityDecoder[A]): Task[A]
- Annotations
- @deprecated
- Deprecated
(Since version 0.14) Use expect
-
def
getAs[A](uri: Uri)(implicit d: EntityDecoder[A]): Task[A]
Submits a GET request and decodes the response.
Submits a GET request and decodes the response. The underlying HTTP connection is closed at the completion of the decoding.
- Annotations
- @deprecated
- Deprecated
(Since version 0.14) Use expect
-
def
prepAs[T](req: Task[Request])(implicit d: EntityDecoder[T]): Task[T]
- Annotations
- @deprecated
- Deprecated
(Since version 0.14) Use expect
-
def
prepAs[A](req: Request)(implicit d: EntityDecoder[A]): Task[A]
- Annotations
- @deprecated
- Deprecated
(Since version 0.14) Use expect