=htc,htp Small fix in scaladoc, add FIXME reminder
This commit is contained in:
parent
91a0dbe036
commit
ef34319987
2 changed files with 5 additions and 4 deletions
|
|
@ -26,8 +26,9 @@ class FastFuture[A](val future: Future[A]) extends AnyVal {
|
|||
transformWith(f, FastFuture.failed)
|
||||
|
||||
def filter(pred: A ⇒ Boolean)(implicit executor: ExecutionContext): Future[A] =
|
||||
flatMap {
|
||||
r ⇒ if (pred(r)) future else throw new NoSuchElementException("Future.filter predicate is not satisfied")
|
||||
flatMap { r ⇒
|
||||
if (pred(r)) future
|
||||
else throw new NoSuchElementException("Future.filter predicate is not satisfied") // FIXME: avoid stack trace generation
|
||||
}
|
||||
|
||||
def foreach(f: A ⇒ Unit)(implicit ec: ExecutionContext): Unit = map(f)
|
||||
|
|
|
|||
|
|
@ -68,14 +68,14 @@ object Marshaller
|
|||
|
||||
/**
|
||||
* Helper for creating a "super-marshaller" from a number of "sub-marshallers".
|
||||
* Content-negotiation determines, which "sub-marshallers" eventually gets to do the job.
|
||||
* Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.
|
||||
*/
|
||||
def oneOf[A, B](marshallers: Marshaller[A, B]*)(implicit ec: ExecutionContext): Marshaller[A, B] =
|
||||
Marshaller { a ⇒ FastFuture.sequence(marshallers.map(_(a))).fast.map(_.flatten.toList) }
|
||||
|
||||
/**
|
||||
* Helper for creating a "super-marshaller" from a number of values and a function producing "sub-marshallers"
|
||||
* from these values. Content-negotiation determines, which "sub-marshallers" eventually gets to do the job.
|
||||
* from these values. Content-negotiation determines, which "sub-marshaller" eventually gets to do the job.
|
||||
*/
|
||||
def oneOf[T, A, B](values: T*)(f: T ⇒ Marshaller[A, B])(implicit ec: ExecutionContext): Marshaller[A, B] =
|
||||
oneOf(values map f: _*)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue