Permalink
Browse files

remove tailing whitespaces

```
git ls-files | xargs sed -i '' -e's/[[:space:]]*$//'
```
  • Loading branch information...
xuwei-k committed Jun 5, 2016
1 parent 3228322 commit 9eeccf5f2634c6dd91127ccca3409d7aec4998e3
Showing with 529 additions and 542 deletions.
  1. +1 −1 .gitignore
  2. +1 −1 CONTRIBUTING.md
  3. +5 −5 concurrent/src/main/scala/scalaz/concurrent/Atomic.scala
  4. +6 −6 concurrent/src/main/scala/scalaz/concurrent/BooleanLatch.scala
  5. +4 −4 concurrent/src/main/scala/scalaz/concurrent/Chan.scala
  6. +26 −26 concurrent/src/main/scala/scalaz/concurrent/Future.scala
  7. +7 −7 concurrent/src/main/scala/scalaz/concurrent/MVar.scala
  8. +14 −14 concurrent/src/main/scala/scalaz/concurrent/Task.scala
  9. +4 −4 core/src/main/scala/scalaz/Adjunction.scala
  10. +5 −5 core/src/main/scala/scalaz/Applicative.scala
  11. +2 −2 core/src/main/scala/scalaz/Apply.scala
  12. +4 −4 core/src/main/scala/scalaz/Bifoldable.scala
  13. +5 −5 core/src/main/scala/scalaz/Bifunctor.scala
  14. +3 −3 core/src/main/scala/scalaz/Bitraverse.scala
  15. +7 −7 core/src/main/scala/scalaz/Catchable.scala
  16. +1 −1 core/src/main/scala/scalaz/Category.scala
  17. +5 −5 core/src/main/scala/scalaz/Composition.scala
  18. +2 −2 core/src/main/scala/scalaz/Const.scala
  19. +1 −1 core/src/main/scala/scalaz/ContravariantCoyoneda.scala
  20. +4 −4 core/src/main/scala/scalaz/Coproduct.scala
  21. +2 −2 core/src/main/scala/scalaz/DList.scala
  22. +2 −2 core/src/main/scala/scalaz/Dequeue.scala
  23. +2 −2 core/src/main/scala/scalaz/Diev.scala
  24. +2 −2 core/src/main/scala/scalaz/Either.scala
  25. +3 −3 core/src/main/scala/scalaz/EitherT.scala
  26. +1 −1 core/src/main/scala/scalaz/Foldable.scala
  27. +1 −1 core/src/main/scala/scalaz/Foldable1.scala
  28. +2 −2 core/src/main/scala/scalaz/Functor.scala
  29. +1 −1 core/src/main/scala/scalaz/IdT.scala
  30. +5 −5 core/src/main/scala/scalaz/IndexedContsT.scala
  31. +1 −1 core/src/main/scala/scalaz/Kleisli.scala
  32. +1 −1 core/src/main/scala/scalaz/LazyEitherT.scala
  33. +1 −1 core/src/main/scala/scalaz/LazyOption.scala
  34. +7 −7 core/src/main/scala/scalaz/ListT.scala
  35. +20 −20 core/src/main/scala/scalaz/Maybe.scala
  36. +1 −1 core/src/main/scala/scalaz/MaybeT.scala
  37. +7 −7 core/src/main/scala/scalaz/MonadTrans.scala
  38. +1 −1 core/src/main/scala/scalaz/NaturalTransformation.scala
  39. +4 −4 core/src/main/scala/scalaz/NonEmptyList.scala
  40. +4 −4 core/src/main/scala/scalaz/Nondeterminism.scala
  41. +3 −3 core/src/main/scala/scalaz/OptionT.scala
  42. +2 −2 core/src/main/scala/scalaz/Order.scala
  43. +1 −1 core/src/main/scala/scalaz/Plus.scala
  44. +2 −2 core/src/main/scala/scalaz/Profunctor.scala
  45. +11 −11 core/src/main/scala/scalaz/ReaderWriterStateT.scala
  46. +2 −2 core/src/main/scala/scalaz/Semigroup.scala
  47. +17 −17 core/src/main/scala/scalaz/StreamT.scala
  48. +1 −1 core/src/main/scala/scalaz/Tag.scala
  49. +1 −1 core/src/main/scala/scalaz/Traverse.scala
  50. +1 −1 core/src/main/scala/scalaz/Unapply.scala
  51. +3 −3 core/src/main/scala/scalaz/WriterT.scala
  52. +2 −2 core/src/main/scala/scalaz/Zap.scala
  53. +7 −7 core/src/main/scala/scalaz/std/Either.scala
  54. +4 −4 core/src/main/scala/scalaz/std/List.scala
  55. +5 −5 core/src/main/scala/scalaz/std/Option.scala
  56. +3 −3 core/src/main/scala/scalaz/std/PartialFunction.scala
  57. +3 −3 core/src/main/scala/scalaz/std/Stream.scala
  58. +1 −1 core/src/main/scala/scalaz/std/math/OrderingInstances.scala
  59. +5 −6 core/src/main/scala/scalaz/syntax/ArrowSyntax.scala
  60. +5 −6 core/src/main/scala/scalaz/syntax/AssociativeSyntax.scala
  61. +5 −6 core/src/main/scala/scalaz/syntax/BifoldableSyntax.scala
  62. +5 −6 core/src/main/scala/scalaz/syntax/BifunctorSyntax.scala
  63. +5 −6 core/src/main/scala/scalaz/syntax/BitraverseSyntax.scala
  64. +5 −6 core/src/main/scala/scalaz/syntax/CategorySyntax.scala
  65. +5 −6 core/src/main/scala/scalaz/syntax/ChoiceSyntax.scala
  66. +5 −6 core/src/main/scala/scalaz/syntax/ComposeSyntax.scala
  67. +1 −1 core/src/main/scala/scalaz/syntax/EnumSyntax.scala
  68. +1 −1 core/src/main/scala/scalaz/syntax/EqualSyntax.scala
  69. +3 −3 core/src/main/scala/scalaz/syntax/MonadListenSyntax.scala
  70. +1 −1 core/src/main/scala/scalaz/syntax/MonadPlusSyntax.scala
  71. +1 −1 core/src/main/scala/scalaz/syntax/MonoidSyntax.scala
  72. +1 −1 core/src/main/scala/scalaz/syntax/OrderSyntax.scala
  73. +5 −6 core/src/main/scala/scalaz/syntax/ProChoiceSyntax.scala
  74. +5 −6 core/src/main/scala/scalaz/syntax/ProfunctorSyntax.scala
  75. +1 −1 core/src/main/scala/scalaz/syntax/SemigroupSyntax.scala
  76. +1 −1 core/src/main/scala/scalaz/syntax/ShowSyntax.scala
  77. +5 −6 core/src/main/scala/scalaz/syntax/SplitSyntax.scala
  78. +5 −6 core/src/main/scala/scalaz/syntax/StrongSyntax.scala
  79. +1 −1 effect/src/main/scala/scalaz/effect/LiftIO.scala
  80. +1 −1 effect/src/main/scala/scalaz/effect/RegionT.scala
  81. +1 −1 effect/src/main/scala/scalaz/effect/Resource.scala
  82. +1 −1 effect/src/main/scala/scalaz/std/effect/AllEffectInstances.scala
  83. +1 −1 effect/src/main/scala/scalaz/std/effect/Closeable.scala
  84. +1 −1 effect/src/main/scala/scalaz/syntax/effect/EffectSyntax.scala
  85. +1 −1 effect/src/main/scala/scalaz/syntax/effect/LiftIOSyntax.scala
  86. +1 −1 effect/src/main/scala/scalaz/syntax/effect/MonadCatchIOSyntax.scala
  87. +2 −2 effect/src/main/scala/scalaz/syntax/effect/ResourceSyntax.scala
  88. +20 −20 example/src/main/scala/scalaz/example/AdjunctUsage.scala
  89. +3 −3 example/src/main/scala/scalaz/example/ArrowUsage.scala
  90. +4 −4 example/src/main/scala/scalaz/example/BifunctorUsage.scala
  91. +3 −3 example/src/main/scala/scalaz/example/CaseInsensitiveUsage.scala
  92. +1 −1 example/src/main/scala/scalaz/example/EndoUsage.scala
  93. +2 −2 example/src/main/scala/scalaz/example/FingerTreeUsage.scala
  94. +2 −2 example/src/main/scala/scalaz/example/FoldableUsage.scala
  95. +5 −5 example/src/main/scala/scalaz/example/FunctorUsage.scala
  96. +5 −5 example/src/main/scala/scalaz/example/IListUsage.scala
  97. +1 −1 example/src/main/scala/scalaz/example/KleisliUsage.scala
  98. +3 −3 example/src/main/scala/scalaz/example/NameNeedValueUsage.scala
  99. +1 −1 example/src/main/scala/scalaz/example/NewTypeUsage.scala
  100. +6 −6 example/src/main/scala/scalaz/example/ReaderWriterStateTUsage.scala
  101. +1 −1 example/src/main/scala/scalaz/example/StringUsage.scala
  102. +11 −11 example/src/main/scala/scalaz/example/WriterUsage.scala
  103. +1 −1 example/src/main/scala/scalaz/example/concurrent/ChanUsage.scala
  104. +3 −3 example/src/main/scala/scalaz/example/concurrent/MVarUsage.scala
  105. +1 −1 example/src/main/scala/scalaz/example/transformers/typecheck/TypeCheckerWithExplicitTypes.scala
  106. +1 −1 .../scala/scalaz/example/transformers/typecheck/TypeCheckerWithExplicitTypes_MonadTransformers.scala
  107. +1 −1 ...e/src/main/scala/scalaz/example/transformers/typecheck/TypeCheckerWithExplicitTypes_Monadic.scala
  108. +1 −1 iteratee/src/main/scala/scalaz/iteratee/Enumeratee2T.scala
  109. +5 −5 iteratee/src/main/scala/scalaz/iteratee/EnumerateeT.scala
  110. +7 −7 iteratee/src/main/scala/scalaz/iteratee/EnumeratorP.scala
  111. +9 −9 iteratee/src/main/scala/scalaz/iteratee/EnumeratorT.scala
  112. +1 −1 iteratee/src/main/scala/scalaz/iteratee/Iteratee.scala
  113. +7 −7 iteratee/src/main/scala/scalaz/iteratee/IterateeT.scala
  114. +8 −9 project/GenTypeClass.scala
  115. +1 −1 project/Util.scala
  116. +2 −2 project/build.scala
  117. +1 −1 scalacheck-binding/src/main/scala/scalaz/scalacheck/ScalazArbitrary.scala
  118. +3 −3 scalacheck-binding/src/main/scala/scalaz/scalacheck/ScalazProperties.scala
  119. +3 −3 tests/jvm/src/test/scala/scalaz/concurrent/ConcurrentTaskTest.scala
  120. +5 −5 tests/jvm/src/test/scala/scalaz/concurrent/FutureTest.scala
  121. +2 −2 tests/jvm/src/test/scala/scalaz/concurrent/TaskTest.scala
  122. +2 −2 tests/src/test/scala/scalaz/CaseInsensitiveTest.scala
  123. +10 −10 tests/src/test/scala/scalaz/CofreeTest.scala
  124. +1 −1 tests/src/test/scala/scalaz/DListTest.scala
  125. +1 −1 tests/src/test/scala/scalaz/KleisliTest.scala
  126. +4 −4 tests/src/test/scala/scalaz/LazyEitherTTest.scala
  127. +5 −5 tests/src/test/scala/scalaz/LazyEitherTest.scala
  128. +4 −4 tests/src/test/scala/scalaz/LazyOptionTTest.scala
  129. +5 −5 tests/src/test/scala/scalaz/LazyOptionTest.scala
  130. +3 −3 tests/src/test/scala/scalaz/ListTTest.scala
  131. +1 −1 tests/src/test/scala/scalaz/NonEmptyListTest.scala
  132. +3 −3 tests/src/test/scala/scalaz/OneAndTest.scala
  133. +1 −1 tests/src/test/scala/scalaz/OptionTTest.scala
  134. +2 −2 tests/src/test/scala/scalaz/ReaderWriterStateTTest.scala
  135. +5 −5 tests/src/test/scala/scalaz/StreamTTest.scala
  136. +1 −1 tests/src/test/scala/scalaz/WriterTTest.scala
  137. +6 −6 tests/src/test/scala/scalaz/ZipperTest.scala
  138. +6 −6 tests/src/test/scala/scalaz/effect/MonadCatchIOTest.scala
  139. +1 −1 tests/src/test/scala/scalaz/effect/ResourceTest.scala
  140. +2 −2 tests/src/test/scala/scalaz/iteratee/Enumeratee2TTest.scala
  141. +1 −1 tests/src/test/scala/scalaz/iteratee/EnumeratorPTest.scala
  142. +3 −3 tests/src/test/scala/scalaz/std/FunctionTest.scala
  143. +1 −1 tests/src/test/scala/scalaz/std/ListTest.scala
  144. +1 −1 tests/src/test/scala/scalaz/std/OptionTest.scala
  145. +2 −2 tests/src/test/scala/scalaz/std/TupleTest.scala
  146. +4 −4 tests/src/test/scala/scalaz/std/VectorTest.scala
View
@@ -13,4 +13,4 @@ tags
.cache
.classpath
.project
.settings
.settings
View
@@ -243,7 +243,7 @@ but the consistency is worth it.
class Foo[A, F[_], B] // bad
Define type lambdas using the kind-projector plugin. Raw type-lambdas should be defined with either lower case or greek
letters as the type parameters. This helps to distinguish them from the applied types. Type Lambdas should use the
letters as the type parameters. This helps to distinguish them from the applied types. Type Lambdas should use the
kind-projector syntax. Here's some inline syntax examples:
F[X, ?] === ({type λ[α] = F[X, α]})#λ
@@ -10,11 +10,11 @@ trait Atomic[A] {
def get: IO[A]
def getAndSet(a: A): IO[A]
def set(a: => A): IO[Unit]
def update(f: A => A): IO[A] = get flatMap { a =>
def update(f: A => A): IO[A] = get flatMap { a =>
val b = f(a)
compareAndSet(a, b) flatMap { s =>
if (s) IO(b)
compareAndSet(a, b) flatMap { s =>
if (s) IO(b)
else update(f)
}
}
@@ -25,7 +25,7 @@ object Atomic extends Atomics
trait Atomics {
def newAtomic[A](a: A): IO[Atomic[A]] = IO(new Atomic[A] {
val value = new AtomicReference(a)
def compareAndSet(expected: A, newValue: A) = IO(value.compareAndSet(expected, newValue))
def get = IO(value.get)
def getAndSet(a: A) = IO(value.getAndSet(a))
@@ -13,16 +13,16 @@ object BooleanLatch {
val sync = new AbstractQueuedSynchronizer {
val RELEASED = 0
val UNAVAILABLE = -1
setState(UNAVAILABLE)
def released = getState == RELEASED
def unavailable = getState == UNAVAILABLE
override def tryAcquire(ignore: Int) =
if (!released) false
override def tryAcquire(ignore: Int) =
if (!released) false
else compareAndSetState(RELEASED, UNAVAILABLE)
override def tryRelease(ignore: Int) = {
if (unavailable) setState(RELEASED)
true
@@ -23,16 +23,16 @@ object Chan {
import Chan._
private[this] case class ChItem[A](a: A, end: ChStream[A])
private[this] class ChanImpl[A](readVar: MVar[ChStream[A]], writeVar: MVar[ChStream[A]]) extends Chan[A] {
def read =
readVar.modify(readEnd =>
def read =
readVar.modify(readEnd =>
for {
item <- readEnd.read
} yield (item.end, item.a))
def write(a: A) =
def write(a: A) =
for {
newHole <- newEmptyMVar[ChItem[A]]
_ <-
_ <-
for {
oldHole <- writeVar.take
_ <- oldHole.put(ChItem(a, newHole))
@@ -79,11 +79,11 @@ sealed abstract class Future[+A] {
onFinish(x => Trampoline.delay(g(x)) map (_ unsafePerformListen cb))
}
@deprecated("use unsafePerformListen", "7.2")
def listen(cb: A => Trampoline[Unit]): Unit =
unsafePerformListen(cb)
/**
* Run this computation to obtain an `A`, so long as `cancel` remains false.
* Because of trampolining, we get frequent opportunities to cancel
@@ -107,7 +107,7 @@ sealed abstract class Future[+A] {
@deprecated("use unsafePerformListenInterruptibly", "7.2")
def listenInterruptibly(cb: A => Trampoline[Unit], cancel: AtomicBoolean): Unit =
unsafePerformListenInterruptibly(cb, cancel)
/**
* Evaluate this `Future` to a result, or another asynchronous computation.
* This has the effect of stripping off any 'pure' trampolined computation at
@@ -132,10 +132,10 @@ sealed abstract class Future[+A] {
/**
* Begins running this `Future` and returns a new future that blocks
* waiting for the result. Note that this will start executing side effects
* immediately, and is thus morally equivalent to `unsafePerformIO`. The
* waiting for the result. Note that this will start executing side effects
* immediately, and is thus morally equivalent to `unsafePerformIO`. The
* resulting `Future` cannot be rerun to repeat the effects.
*
*
* Use with care.
*/
def unsafeStart: Future[A] = {
@@ -144,7 +144,7 @@ sealed abstract class Future[+A] {
unsafePerformAsync { a => result = Some(a); latch.countDown }
delay { latch.await; result.get }
}
@deprecated("use unsafeStart", "7.2")
def start: Future[A] =
unsafeStart
@@ -161,7 +161,7 @@ sealed abstract class Future[+A] {
@deprecated("use unsafePerformAsync", "7.2")
def runAsync(cb: A => Unit): Unit =
unsafePerformAsync(cb)
/**
* Run this computation to obtain an `A`, so long as `cancel` remains false.
* Because of trampolining, we get frequent opportunities to cancel
@@ -174,7 +174,7 @@ sealed abstract class Future[+A] {
@deprecated("use unsafePerformAsyncInterruptibly", "7.2")
def runAsyncInterruptibly(cb: A => Unit, cancel: AtomicBoolean): Unit =
unsafePerformAsyncInterruptibly(cb, cancel)
/** Run this `Future` and block awaiting its result. */
def unsafePerformSync: A = this match {
case Now(a) => a
@@ -190,19 +190,19 @@ sealed abstract class Future[+A] {
@deprecated("use unsafePerformSync", "7.2")
def run: A =
unsafePerformSync
/**
* Run this `Future` and block until its result is available, or until
* `timeoutInMillis` milliseconds have elapsed, at which point a `TimeoutException`
* will be thrown and the `Future` will attempt to be canceled.
*/
def unsafePerformSyncFor(timeoutInMillis: Long): A =
def unsafePerformSyncFor(timeoutInMillis: Long): A =
unsafePerformSyncAttemptFor(timeoutInMillis) match {
case -\/(e) => throw e
case \/-(a) => a
}
def unsafePerformSyncFor(timeout: Duration): A =
def unsafePerformSyncFor(timeout: Duration): A =
unsafePerformSyncFor(timeout.toMillis)
@deprecated("use unsafePerformSyncFor", "7.2")
@@ -213,8 +213,8 @@ sealed abstract class Future[+A] {
def runFor(timeout: Duration): A =
unsafePerformSyncFor(timeout)
/** Like `unsafePerformSyncFor`, but returns `TimeoutException` as left value.
/** Like `unsafePerformSyncFor`, but returns `TimeoutException` as left value.
* Will not report any other exceptions that may be raised during computation of `A`*/
def unsafePerformSyncAttemptFor(timeoutInMillis: Long): Throwable \/ A = {
val sync = new SyncVar[Throwable \/ A]
@@ -226,7 +226,7 @@ sealed abstract class Future[+A] {
}
}
def unsafePerformSyncAttemptFor(timeout: Duration): Throwable \/ A =
def unsafePerformSyncAttemptFor(timeout: Duration): Throwable \/ A =
unsafePerformSyncAttemptFor(timeout.toMillis)
@deprecated("use unsafePerformSyncAttemptFor", "7.2")
@@ -236,8 +236,8 @@ sealed abstract class Future[+A] {
@deprecated("use unsafePerformSyncAttemptFor", "7.2")
def attemptRunFor(timeout: Duration): Throwable \/ A =
unsafePerformSyncAttemptFor(timeout)
/**
* Returns a `Future` which returns a `TimeoutException` after `timeoutInMillis`,
* and attempts to cancel the running computation.
@@ -250,29 +250,29 @@ sealed abstract class Future[+A] {
val cancel = new AtomicBoolean(false)
val done = new AtomicBoolean(false)
scheduler.schedule(new Runnable {
def run() {
def run() {
if (done.compareAndSet(false,true)) {
cancel.set(true)
cb(-\/(new TimeoutException(s"Timed out after $timeoutInMillis milliseconds")))
}
}
}
}
, timeoutInMillis, TimeUnit.MILLISECONDS)
unsafePerformAsyncInterruptibly(a => if(done.compareAndSet(false,true)) cb(\/-(a)), cancel)
unsafePerformAsyncInterruptibly(a => if(done.compareAndSet(false,true)) cb(\/-(a)), cancel)
}
def timed(timeout: Duration)(implicit scheduler:ScheduledExecutorService = Strategy.DefaultTimeoutScheduler): Future[Throwable \/ A] =
def timed(timeout: Duration)(implicit scheduler:ScheduledExecutorService = Strategy.DefaultTimeoutScheduler): Future[Throwable \/ A] =
timed(timeout.toMillis)
@deprecated("use timed", "7.2")
@deprecated("use timed", "7.2")
def unsafePerformTimed(timeout: Duration)(implicit scheduler:ScheduledExecutorService = Strategy.DefaultTimeoutScheduler): Future[Throwable \/ A] =
timed(timeout.toMillis)
@deprecated("use timed", "7.2")
@deprecated("use timed", "7.2")
def unsafePerformTimed(timeoutInMillis: Long)(implicit scheduler:ScheduledExecutorService): Future[Throwable \/ A] =
timed(timeoutInMillis)
timed(timeoutInMillis)
/**
* Returns a `Future` that delays the execution of this `Future` by the duration `t`.
*/
@@ -11,7 +11,7 @@ sealed abstract class MVar[A] {
def put(a: => A): IO[Unit]
def take: IO[A]
final def read: IO[A] =
final def read: IO[A] =
for {
a <- take
_ <- put(a)
@@ -49,17 +49,17 @@ private[this] class MVarImpl[A](value: Atomic[Option[A]], readLatch: PhasedLatch
_ <- writeLatch.release()
} yield a
)
def put(a: => A) = write(a, value.get)
def read(reader: => IO[Option[A]]) = {
def read_ : IO[A] =
def read_ : IO[A] =
for {
p <- readLatch.currentPhase
r <- reader
a <- r match {
case Some(a) => IO(a)
case None =>
case None =>
for {
_ <- readLatch.awaitPhase(p) // we don't have a value so we wait for someone to put one
a <- read_ // someone has put a value so now we try to read it
@@ -68,15 +68,15 @@ private[this] class MVarImpl[A](value: Atomic[Option[A]], readLatch: PhasedLatch
} yield a
read_
}
def write(a: => A, read: => IO[Option[A]]): IO[Unit] = writeLatch.currentPhase flatMap { p =>
read flatMap(v => v match {
case Some(_) =>
case Some(_) =>
for {
_ <- writeLatch awaitPhase p // if there is a value, wait until someone takes it
_ <- write(a, read) // someone has taken the value, try and write it again
} yield ()
case None =>
case None =>
value.compareAndSet(v, Some(a)) flatMap { set => // There is no value, so it's time to try and write one.
if (!set) write(a, read) // If the value has changed, the write will fail so we'll need to try it again.
else readLatch.release // If the write succeeded, release a thread waiting for a value.
@@ -95,7 +95,7 @@ class Task[+A](val get: Future[Throwable \/ A]) {
* throw any exceptions generated by the `Task`. To return exceptions
* in an `\/`, use `unsafePerformSyncAttempt`.
*/
def unsafePerformSync: A =
def unsafePerformSync: A =
get.unsafePerformSync match {
case -\/(e) => throw e
case \/-(a) => a
@@ -104,15 +104,15 @@ class Task[+A](val get: Future[Throwable \/ A]) {
@deprecated("use unsafePerformSync", "7.2")
def run: A =
unsafePerformSync
/** Like `unsafePerformSync`, but returns exceptions as values. */
def unsafePerformSyncAttempt: Throwable \/ A =
try get.unsafePerformSync catch { case t: Throwable => -\/(t) }
@deprecated("use unsafePerformSyncAttempt", "7.2")
def attemptRun: Throwable \/ A =
unsafePerformSyncAttempt
/**
* Run this computation to obtain an `A`, so long as `cancel` remains false.
* Because of trampolining, we get frequent opportunities to cancel
@@ -125,7 +125,7 @@ class Task[+A](val get: Future[Throwable \/ A]) {
@deprecated("use unsafePerformAsyncInterruptibly", "7.2")
def runAsyncInterruptibly(f: (Throwable \/ A) => Unit, cancel: AtomicBoolean): Unit =
unsafePerformAsyncInterruptibly(f, cancel)
/**
* Similar to `unsafePerformAsyncInterruptibly(f,cancel)` except instead of interrupting by setting cancel to true,
* It returns the function, that, when applied will interrupt the task.
@@ -157,9 +157,9 @@ class Task[+A](val get: Future[Throwable \/ A]) {
}
@deprecated("use unsafePerformAsyncInterruptibly", "7.2")
def runAsyncInterruptibly(f: (Throwable \/ A) => Unit) : () => Unit =
def runAsyncInterruptibly(f: (Throwable \/ A) => Unit) : () => Unit =
unsafePerformAsyncInterruptibly(f)
/**
* Run this computation to obtain either a result or an exception, then
* invoke the given callback. Any pure, non-asynchronous computation at the
@@ -173,27 +173,27 @@ class Task[+A](val get: Future[Throwable \/ A]) {
@deprecated("use unsafePerformAsync", "7.2")
def runAsync(f: (Throwable \/ A) => Unit): Unit =
unsafePerformAsync(f)
/**
* Run this `Task` and block until its result is available, or until
* `timeoutInMillis` milliseconds have elapsed, at which point a `TimeoutException`
* will be thrown and the `Task` will attempt to be canceled.
*/
def unsafePerformSyncFor(timeoutInMillis: Long): A =
def unsafePerformSyncFor(timeoutInMillis: Long): A =
get.unsafePerformSyncFor(timeoutInMillis) match {
case -\/(e) => throw e
case \/-(a) => a
}
def unsafePerformSyncFor(timeout: Duration): A =
def unsafePerformSyncFor(timeout: Duration): A =
unsafePerformSyncFor(timeout.toMillis)
@deprecated("use unsafePerformSyncFor", "7.2")
def runFor(timeoutInMillis: Long): A =
def runFor(timeoutInMillis: Long): A =
unsafePerformSyncFor(timeoutInMillis)
@deprecated("use unsafePerformSyncFor", "7.2")
def runFor(timeout: Duration): A =
def runFor(timeout: Duration): A =
unsafePerformSyncFor(timeout)
/**
@@ -227,11 +227,11 @@ class Task[+A](val get: Future[Throwable \/ A]) {
@deprecated("use timed", "7.2")
def unsafePerformTimed(timeout: Duration)(implicit scheduler:ScheduledExecutorService = Strategy.DefaultTimeoutScheduler): Task[A] =
timed(timeout)
@deprecated("use timed", "7.2")
def unsafePerformTimed(timeoutInMillis: Long)(implicit scheduler:ScheduledExecutorService): Task[A] =
timed(timeoutInMillis)
/**
* Retries this task if it fails, once for each element in `delays`,
* each retry delayed by the corresponding duration, accumulating
@@ -244,7 +244,7 @@ class Task[+A](val get: Future[Throwable \/ A]) {
@deprecated("use retryAccumulating", "7.2")
def unsafePerformRetryAccumulating(delays: Seq[Duration], p: (Throwable => Boolean) = _.isInstanceOf[Exception]): Task[(A, List[Throwable])] =
retryAccumulating(delays, p)
/**
* Retries this task if it fails, once for each element in `delays`,
* each retry delayed by the corresponding duration.
Oops, something went wrong.

0 comments on commit 9eeccf5

Please sign in to comment.