sealed abstract class EndpointResult[+A] extends AnyRef
A result returned from an Endpoint. This models Option[(Input, Future[Output])]
and
represents two cases:
- Endpoint is matched (think of 200).
- Endpoint is not matched (think of 404, 405, etc).
In its current state, EndpointResult.NotMatched
represented with two cases:
EndpointResult.NotMatched
(very generic result usually indicating 404)EndpointResult.NotMatched.MethodNotAllowed
(indicates 405)
API methods exposed on this type are mostly introduced for testing.
This class also provides various of awaitX
methods useful for testing and experimenting.
- Source
- EndpointResult.scala
- Alphabetic
- By Inheritance
- EndpointResult
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from EndpointResult[A] to any2stringadd[EndpointResult[A]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (EndpointResult[A], B)
- Implicit
- This member is added by an implicit conversion from EndpointResult[A] to ArrowAssoc[EndpointResult[A]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
final
def
awaitOutput(d: Duration = Duration.Top): Option[Try[Output[A]]]
Awaits for an Output wrapped with Try (indicating if the com.twitter.util.Future is failed).
Awaits for an Output wrapped with Try (indicating if the com.twitter.util.Future is failed).
- returns
Some(output)
if this endpoint was matched on a given input,None
otherwise.
- Note
This method is blocking. Never use it in production.
-
final
def
awaitOutputUnsafe(d: Duration = Duration.Top): Option[Output[A]]
Awaits an Output of the Endpoint result or throws an exception if an underlying com.twitter.util.Future is failed.
Awaits an Output of the Endpoint result or throws an exception if an underlying com.twitter.util.Future is failed.
- returns
Some(output)
if this endpoint was matched on a given input,None
otherwise.
- Note
This method is blocking. Never use it in production.
-
final
def
awaitValue(d: Duration = Duration.Top): Option[Try[A]]
Awaits a value from the Output wrapped with Try (indicating if either the com.twitter.util.Future is failed or Output wasn't a payload).
Awaits a value from the Output wrapped with Try (indicating if either the com.twitter.util.Future is failed or Output wasn't a payload).
- returns
Some(value)
if this endpoint was matched on a given input,None
otherwise.
- Note
This method is blocking. Never use it in production.
-
final
def
awaitValueUnsafe(d: Duration = Duration.Top): Option[A]
Awaits a value from the Output or throws an exception if either an underlying com.twitter.util.Future is failed or Output wasn't a payload.
Awaits a value from the Output or throws an exception if either an underlying com.twitter.util.Future is failed or Output wasn't a payload.
- returns
Some(value)
if this endpoint was matched on a given input,None
otherwise.
- Note
@note This method is blocking. Never use it in production.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
ensuring(cond: (EndpointResult[A]) ⇒ Boolean, msg: ⇒ Any): EndpointResult[A]
- Implicit
- This member is added by an implicit conversion from EndpointResult[A] to Ensuring[EndpointResult[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (EndpointResult[A]) ⇒ Boolean): EndpointResult[A]
- Implicit
- This member is added by an implicit conversion from EndpointResult[A] to Ensuring[EndpointResult[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): EndpointResult[A]
- Implicit
- This member is added by an implicit conversion from EndpointResult[A] to Ensuring[EndpointResult[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): EndpointResult[A]
- Implicit
- This member is added by an implicit conversion from EndpointResult[A] to Ensuring[EndpointResult[A]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from EndpointResult[A] to StringFormat[EndpointResult[A]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
output: Option[Future[Output[A]]]
Runs and returns the Output (wrapped with future) after an Endpoint is matched.
-
final
def
remainder: Option[Input]
Returns the remainder of the Input after an Endpoint is matched.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- final def trace: Option[Trace]
-
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
- @native() @throws( ... )
-
def
→[B](y: B): (EndpointResult[A], B)
- Implicit
- This member is added by an implicit conversion from EndpointResult[A] to ArrowAssoc[EndpointResult[A]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
This is the API documentation for finch
Finch is a thin layer of purely functional basic blocks atop of [Finagle][finagle] for building composable HTTP APIs. Its mission is to provide the developers simple and robust HTTP primitives being as close as possible to the bare metal Finagle API.
Finch uses multi-project structure and contains of the following _modules_:
Please refer to the documentation for a more detailed introduction to the library.