io.finch

micro

package micro

An experimental package that enables a secret Finch mode: "Your REST API as a Monad". The idea is to replace Service with RequestReader. Both RequestReader and Service do similar things, process request (they both functions Req => Future[Rep]), but the RequestReader is insanely composable (being a monad), so it makes sense to route request directly to RequestReader. Thus, an Endpoint is Router[RequestReader[HttpResponse]].

The high-level idea behind this package is to allow users to work the domain types that matter rather than deal with raw HTTP types directly.

In order to make things clear, this package introduces a new type Micro (from "microservice"), which is actually an alias to RequestReader, since it's no longer a reader but _processor_.

See this gist for more details.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. micro
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type Endpoint = RouterN[PMicro[HttpRequest, HttpResponse]]

    A PEndpoint with request type fixed to HttpRequest.

  2. type Micro[A] = PRequestReader[HttpRequest, A]

    A PMicro with request type fixed to HttpRequest.

  3. implicit class MicroRouterOps[R, A] extends AnyRef

  4. type PEndpoint[R] = RouterN[PMicro[R, HttpResponse]]

    A Router that fetches a PMicro is called an endpoint.

  5. type PMicro[R, A] = PRequestReader[R, A]

    An alias for polymorphic PRequestReader.

Value Members

  1. val Micro: RequestReader.type

    A companion object for Micro.

  2. implicit def endpointToFinagleService[M, R](r: Router[M])(implicit evM: (M) ⇒ PMicro[R, HttpResponse], evR: %>[R, HttpRequest]): Service[R, HttpResponse]

  3. implicit def microRouterToEndpoint[R, M](r: Router[M])(implicit ev: (M) ⇒ PMicro[R, HttpResponse]): PEndpoint[R]

  4. implicit def microToHttpMicro[R, A](m: PMicro[R, A])(implicit e: EncodeResponse[A]): PMicro[R, HttpResponse]

Inherited from AnyRef

Inherited from Any

Ungrouped