A service with a constant reply.
A service with a constant reply. Always available; never closable.
constant for a Java compatible API.
Java compatible API for const as const
is a reserved word in Java
A convenience method for creating Services
from a Function1
of
Req
to a Future[Rep]
.
A future of a service is a pending service.
A future of a service is a pending service.
Requests wait behind resolution of the future. If resolution fails, all requests to this service reflect the same failure. While resolution is pending, the status of the service is Busy, otherwise it's whatever the underlying service reports.
Closing the service is uninterruptible and instant: failing all subsequent requests, and interrupting those in flight. Close returns Future.Done always, independent of the underlying service.
val svc = Service.pending(Future.never) val rep = svc(1) val closed = svc.close() Await.result(closed) // Future.Done Await.result(rep) // Exception: Service is closed
Note: Because queued requests rely on queue order of future callbacks, it's not guaranteed that requests to the underlying service will be received in the same order they were sent.
Wrap the given service such that any synchronously thrown NonFatal
exceptions are lifted into Future.exceptions
.