object ServerServiceCall
- Source
- ServerServiceCall.scala
- Alphabetic
- By Inheritance
- ServerServiceCall
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply[Request, Response](serviceCall: (RequestHeader, Request) ⇒ Future[(ResponseHeader, Response)]): ServerServiceCall[Request, Response]
A service call that can handle headers.
A service call that can handle headers.
This exists as a convenience function for implementing service calls that handle the request and response headers.
-
def
apply[Request, Response](serviceCall: (Request) ⇒ Future[Response]): ServerServiceCall[Request, Response]
Factory for creating a ServerServiceCall.
Factory for creating a ServerServiceCall.
This exists as a convenience function for implementing service calls that need to be composed with other calls that handle headers.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
compose[Request, Response](block: (RequestHeader) ⇒ ServerServiceCall[Request, Response]): ServerServiceCall[Request, Response]
Compose a server service call.
Compose a server service call.
This is useful for implementing service call composition. For example:
def authenticated[Request, Response]( authenticatedServiceCall: String => ServerServiceCall[Request, Response] ): ServerServiceCall[Request, Response] = {
ServerServiceCall.compose { requestHeader =>
// Get the logged in user ID val userId = requestHeader.principal.getOrElse { throw new NotAuthenticated("Not authenticated") }.getName
// Pass the user id to the composed service call authenticatedServiceCall(userId) } }
- block
The block that will do the composition.
- returns
A service call.
-
def
composeAsync[Request, Response](block: (RequestHeader) ⇒ Future[ServerServiceCall[Request, Response]]): ServerServiceCall[Request, Response]
Compose a header service call asynchronously.
Compose a header service call asynchronously.
This is useful for implementing service call composition. For example:
def authenticated[Request, Response]( authenticatedServiceCall: String => ServerServiceCall[Request, Response] ): ServerServiceCall[Request, Response] = {
ServerServiceCall.composeAsync { requestHeader =>
// Get the logged in user ID val userId = requestHeader.principal.getOrElse { throw new NotAuthenticated("Not authenticated") }.getName
// Load the user from the user service val userFuture: Future[User] = userService.loadUser(userId)
// Pass the user to the composed service call userFuture.map(user => authenticatedServiceCall(user)) } }
- block
The block that will do the composition.
- returns
A service call.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
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
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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( ... ) @native()