akka.http.scaladsl

HttpExt

class HttpExt extends Extension

Source
Http.scala
Linear Supertypes
Extension, AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HttpExt
  2. Extension
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpExt(config: Config)(implicit system: ActorSystem)

Type Members

  1. type ClientLayer = BidiFlow[HttpRequest, ByteString, ByteString, HttpResponse, Unit]

    The type of the client-side HTTP layer as a stand-alone BidiStage that can be put atop the TCP layer to form an HTTP client.

    The type of the client-side HTTP layer as a stand-alone BidiStage that can be put atop the TCP layer to form an HTTP client.

    +------+
    HttpRequest  ~>|      |~> ByteString
                   | bidi |
    HttpResponse <~|      |<~ ByteString
                   +------+
  2. type ServerLayer = BidiFlow[HttpResponse, ByteString, ByteString, HttpRequest, Unit]

    The type of the server-side HTTP layer as a stand-alone BidiStage that can be put atop the TCP layer to form an HTTP server.

    The type of the server-side HTTP layer as a stand-alone BidiStage that can be put atop the TCP layer to form an HTTP server.

    +------+
    HttpResponse ~>|      |~> ByteString
                   | bidi |
    HttpRequest  <~|      |<~ ByteString
                   +------+

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from HttpExt to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (HttpExt, B)

    Implicit information
    This member is added by an implicit conversion from HttpExt to ArrowAssoc[HttpExt] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def bind(interface: String, port: Int = 80, backlog: Int = 100, options: Traversable[SocketOption] = Nil, settings: ServerSettings = ServerSettings(system), log: LoggingAdapter = system.log)(implicit fm: FlowMaterializer): Source[IncomingConnection, Future[ServerBinding]]

    Creates a Source of IncomingConnection instances which represents a prospective HTTP server binding on the given endpoint.

    Creates a Source of IncomingConnection instances which represents a prospective HTTP server binding on the given endpoint. If the given port is 0 the resulting source can be materialized several times. Each materialization will then be assigned a new local port by the operating system, which can then be retrieved by the materialized ServerBinding. If the given port is non-zero subsequent materialization attempts of the produced source will immediately fail, unless the first materialization has already been unbound. Unbinding can be triggered via the materialized ServerBinding.

  10. def bindAndHandle(handler: Flow[HttpRequest, HttpResponse, Any], interface: String, port: Int = 80, backlog: Int = 100, options: Traversable[SocketOption] = Nil, settings: ServerSettings = ServerSettings(system), log: LoggingAdapter = system.log)(implicit fm: FlowMaterializer): Future[ServerBinding]

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Note that there is no backpressure being applied to the connections Source, i.e. all connections are being accepted at maximum rate, which, depending on the applications, might present a DoS risk!

  11. def bindAndHandleAsync(handler: (HttpRequest) ⇒ Future[HttpResponse], interface: String, port: Int = 80, backlog: Int = 100, options: Traversable[SocketOption] = Nil, settings: ServerSettings = ServerSettings(system), log: LoggingAdapter = system.log)(implicit fm: FlowMaterializer): Future[ServerBinding]

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Note that there is no backpressure being applied to the connections Source, i.e. all connections are being accepted at maximum rate, which, depending on the applications, might present a DoS risk!

  12. def bindAndHandleSync(handler: (HttpRequest) ⇒ HttpResponse, interface: String, port: Int = 80, backlog: Int = 100, options: Traversable[SocketOption] = Nil, settings: ServerSettings = ServerSettings(system), log: LoggingAdapter = system.log)(implicit fm: FlowMaterializer): Future[ServerBinding]

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Convenience method which starts a new HTTP server at the given endpoint and uses the given handler Flow for processing all incoming connections.

    Note that there is no backpressure being applied to the connections Source, i.e. all connections are being accepted at maximum rate, which, depending on the applications, might present a DoS risk!

  13. def cachedHostConnectionPool[T](setup: HostConnectionPoolSetup)(implicit fm: FlowMaterializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]

    Returns a Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.

    Returns a Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint. For every ActorSystem, target host and pool configuration a separate connection pool is maintained. The HTTP layer transparently manages idle shutdown and restarting of connections pools as configured. The returned Flow instances therefore remain valid throughout the lifetime of the application.

    The internal caching logic guarantees that there will never be more than a single pool running for the given target host endpoint and configuration (in this ActorSystem).

    Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type T from the application which is emitted together with the corresponding response.

  14. def cachedHostConnectionPool[T](host: String, port: Int = 80, options: Traversable[SocketOption] = Nil, settings: ConnectionPoolSettings = ConnectionPoolSettings(system), log: LoggingAdapter = system.log)(implicit fm: FlowMaterializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]

    Returns a Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint.

    Returns a Flow which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing HTTP connections to the given target host endpoint. For every ActorSystem, target host and pool configuration a separate connection pool is maintained. The HTTP layer transparently manages idle shutdown and restarting of connections pools as configured. The returned Flow instances therefore remain valid throughout the lifetime of the application.

    The internal caching logic guarantees that there will never be more than a single pool running for the given target host endpoint and configuration (in this ActorSystem).

    Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type T from the application which is emitted together with the corresponding response.

  15. def clientLayer(remoteAddress: InetSocketAddress, settings: ClientConnectionSettings, log: LoggingAdapter = system.log): ClientLayer

    Constructs a ClientLayer stage using the given ClientConnectionSettings.

  16. def clientLayer(remoteAddress: InetSocketAddress): ClientLayer

    Constructs a ClientLayer stage using the configured default ClientConnectionSettings.

  17. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. def ensuring(cond: (HttpExt) ⇒ Boolean, msg: ⇒ Any): HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to Ensuring[HttpExt] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: (HttpExt) ⇒ Boolean): HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to Ensuring[HttpExt] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def ensuring(cond: Boolean, msg: ⇒ Any): HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to Ensuring[HttpExt] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. def ensuring(cond: Boolean): HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to Ensuring[HttpExt] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  24. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from HttpExt to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  26. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  30. def newHostConnectionPool[T](setup: HostConnectionPoolSetup)(implicit fm: FlowMaterializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]

    Starts a new connection pool to the given host and configuration and returns a Flow which dispatches the requests from all its materializations across this pool.

    Starts a new connection pool to the given host and configuration and returns a Flow which dispatches the requests from all its materializations across this pool. While the started host connection pool internally shuts itself down automatically after the configured idle timeout it will spin itself up again if more requests arrive from an existing or a new client flow materialization. The returned flow therefore remains usable for the full lifetime of the application.

    Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type T from the application which is emitted together with the corresponding response.

  31. def newHostConnectionPool[T](host: String, port: Int = 80, options: Traversable[SocketOption] = Nil, settings: ConnectionPoolSettings = ConnectionPoolSettings(system), log: LoggingAdapter = system.log)(implicit fm: FlowMaterializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), HostConnectionPool]

    Starts a new connection pool to the given host and configuration and returns a Flow which dispatches the requests from all its materializations across this pool.

    Starts a new connection pool to the given host and configuration and returns a Flow which dispatches the requests from all its materializations across this pool. While the started host connection pool internally shuts itself down automatically after the configured idle timeout it will spin itself up again if more requests arrive from an existing or a new client flow materialization. The returned flow therefore remains usable for the full lifetime of the application.

    Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type T from the application which is emitted together with the corresponding response.

  32. final def notify(): Unit

    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  34. def outgoingConnection(host: String, port: Int = 80, localAddress: Option[InetSocketAddress] = None, options: Traversable[SocketOption] = Nil, settings: ClientConnectionSettings = ClientConnectionSettings(system), log: LoggingAdapter = system.log): Flow[HttpRequest, HttpResponse, Future[OutgoingConnection]]

    Creates a Flow representing a prospective HTTP client connection to the given endpoint.

    Creates a Flow representing a prospective HTTP client connection to the given endpoint. Every materialization of the produced flow will attempt to establish a new outgoing connection.

  35. def serverLayer(settings: ServerSettings, log: LoggingAdapter = system.log)(implicit mat: FlowMaterializer): ServerLayer

    Constructs a ServerLayer stage using the given ServerSettings.

    Constructs a ServerLayer stage using the given ServerSettings. The returned BidiFlow isn't reusable and can only be materialized once.

  36. def serverLayer()(implicit mat: FlowMaterializer): ServerLayer

    Constructs a ServerLayer stage using the configured default ServerSettings.

    Constructs a ServerLayer stage using the configured default ServerSettings. The returned BidiFlow can only be materialized once.

  37. def shutdownAllConnectionPools(): Future[Unit]

    Triggers an orderly shutdown of all host connections pools currently maintained by the ActorSystem.

    Triggers an orderly shutdown of all host connections pools currently maintained by the ActorSystem. The returned future is completed when all pools that were live at the time of this method call have completed their shutdown process.

    If existing pool client flows are re-used or new ones materialized concurrently with or after this method call the respective connection pools will be restarted and not contribute to the returned future.

  38. def singleRequest(request: HttpRequest, options: Traversable[SocketOption] = Nil, settings: ConnectionPoolSettings = ConnectionPoolSettings(system), log: LoggingAdapter = system.log)(implicit fm: FlowMaterializer): Future[HttpResponse]

    Fires a single HttpRequest across the (cached) host connection pool for the request's effective URI to produce a response future.

    Fires a single HttpRequest across the (cached) host connection pool for the request's effective URI to produce a response future.

    Note that the request must have either an absolute URI or a valid Host header, otherwise the future will be completed with an error.

  39. def superPool[T](options: Traversable[SocketOption] = Nil, settings: ConnectionPoolSettings = ConnectionPoolSettings(system), log: LoggingAdapter = system.log)(implicit fm: FlowMaterializer): Flow[(HttpRequest, T), (Try[HttpResponse], T), Unit]

    Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URI.

    Creates a new "super connection pool flow", which routes incoming requests to a (cached) host connection pool depending on their respective effective URI. Note that incoming requests must have either an absolute URI or a valid Host header.

    Since the underlying transport usually comprises more than a single connection the produced flow might generate responses in an order that doesn't directly match the consumed requests. For example, if two requests A and B enter the flow in that order the response for B might be produced before the response for A. In order to allow for easy response-to-request association the flow takes in a custom, opaque context object of type T from the application which is emitted together with the corresponding response.

  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  41. def toString(): String

    Definition Classes
    AnyRef → Any
  42. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. def [B](y: B): (HttpExt, B)

    Implicit information
    This member is added by an implicit conversion from HttpExt to ArrowAssoc[HttpExt] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from HttpExt to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (httpExt: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from HttpExt to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (httpExt: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to ArrowAssoc[HttpExt] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (httpExt: ArrowAssoc[HttpExt]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: HttpExt

    Implicit information
    This member is added by an implicit conversion from HttpExt to Ensuring[HttpExt] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (httpExt: Ensuring[HttpExt]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from Extension

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from HttpExt to StringAdd

Inherited by implicit conversion any2stringfmt from HttpExt to StringFormat

Inherited by implicit conversion any2ArrowAssoc from HttpExt to ArrowAssoc[HttpExt]

Inherited by implicit conversion any2Ensuring from HttpExt to Ensuring[HttpExt]

Ungrouped