com.pagerduty.funhttpclient

HttpOps

trait HttpOps[E] extends HttpInstances

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

Type Members

  1. type D[E, A] = EitherT[W, E, A]

    Definition Classes
    HttpInstances
  2. type H[E, A] = Http[E, A]

    Definition Classes
    HttpInstances
  3. trait MonadErrorInstance[E] extends MonadError[H, E] with MonadInstance[E]

    Definition Classes
    HttpInstances
  4. trait MonadInstance[E] extends Monad[[X]Http[E, X]]

    Definition Classes
    HttpInstances
  5. type RequestLog = Vector[LogEntry]

    Definition Classes
    HttpInstances
  6. type W[A] = WriterT[Future, RequestLog, A]

    Definition Classes
    HttpInstances

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. final def ==(arg0: AnyRef): Boolean

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

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

    Definition Classes
    Any
  7. def async[A](a: ⇒ A): Http[E, A]

    Lift a value asynchronously into a HTTP computation.

    Lift a value asynchronously into a HTTP computation.

    The result will be computed concurrently according to ExecutionContext.global.

    lazy val bigExpensiveComputation: Int = ???
    
    val x: Http[String, Int] = HttpOps[String].async(bigExpensiveComputation)
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  15. def liftFuture[A](fut: Future[A]): Http[E, A]

    Wrap an asynchronous computation without handling exceptions.

    Wrap an asynchronous computation without handling exceptions.

    Any exception thrown by the original future will propagate up via Future.failed.

    See also

    HttpOps.liftFutureHandle

  16. def liftFutureHandle[A](fut: Future[A])(f: PartialFunction[Throwable, Http[E, A]]): Http[E, A]

    Wrap an arbitrary asynchronous computation, and selectively recover from them.

    Wrap an arbitrary asynchronous computation, and selectively recover from them.

    If a particular exception isn't handled, then it is propagated up via Future.failed.

    Example
    import scala.concurrent.ExecutionContext.Implicits.global
    
    val x: Http[String, Int] = HttpOps[String].liftFutureHandle(Future("abc".toInt)) {
      case _: NumberFormatException => HttpOps[String].raiseError("Bad number")
    }
    
    scala> x
    res0: com.pagerduty.sprayfunclient.Http[String, Int] = // ...
    See also

    HttpOps.liftFuture

  17. def map2[A, B, C](ha: Http[E, A], hb: Http[E, B])(f: (A, B) ⇒ C): Http[E, C]

    Map over the result of two independent HTTP computations.

    Map over the result of two independent HTTP computations.

    Example
    val x: Http[String, Int] = HttpOps[String].unit(3)
    val y: Http[String, Double] = HttpOps[String].unit(4.2)
    
    scala> HttpOps[String].map2(x, y) { _.toInt + _ }
    res0: com.pagerduty.sprayfunclient.Http[String, Double] = // ...
  18. implicit def monad[E]: MonadInstance[E]

    Definition Classes
    HttpInstances
  19. implicit def monadError[E]: MonadErrorInstance[E]

    Definition Classes
    HttpInstances
  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. final def notify(): Unit

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

    Definition Classes
    AnyRef
  23. def raiseError[A](e: E): Http[E, A]

    Fail the computation with a specific error.

    Fail the computation with a specific error.

    The error will short-circuit any future computations.

    Errors can be manipulated via Http.mapError or recovered from via Http.handleError.

    Example
    def sqrt(x: Double): Http[String, Double] = {
      if (x < 0)
        HttpOps[String].raiseError("negative number")
      else
        HttpOps[String].unit(math.sqrt(x))
    }
    
    scala> sqrt(4.0)
    res0: com.pagerduty.sprayfunclient.Http[String, Double] = // ...
    
    scala> sqrt(-4)
    res1: com.pagerduty.sprayfunclient.Http[String, Double] = // ...
  24. def sequence[A](hs: Seq[Http[E, A]]): Http[E, Seq[A]]

    Execute multiple HTTP computations.

    Execute multiple HTTP computations.

    Asynchronous computations started via async will execute concurrently.

    The computation fails if any one of the computations fail.

    Example
    val x = HttpOps[String].async("First big computation")
    val y = HttpOps[String].async("Second big computation")
    
    scala> HttpOps[String].sequence(Seq(x, y))
    res0: com.pagerduty.sprayfunclient.Http[String, Seq[String]] = // ...
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. def trace(entry: LogEntry): Http[E, Unit]

    Add a HTTP request and it's execution time to the request log.

    Add a HTTP request and it's execution time to the request log.

    This log is accessible when the computation is "run" via Http.asFutureWithLog.

    Note

    request automatically invokes trace, so it is not necessary to invoke it manually when making HTTP requests.

  28. def unit[A](a: A): Http[E, A]

    Lift a value into an HTTP computation.

    Lift a value into an HTTP computation.

    The value is strict (computed immediately).

    Example
    val x = HttpOps[String].unit(3.2)
  29. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from HttpInstances

Inherited from AnyRef

Inherited from Any

Ungrouped