Class

monadasync

AsyncMutex

Related Doc: package monadasync

Permalink

class AsyncMutex[F[_]] extends AsyncSemaphore[F]

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AsyncMutex
  2. AsyncSemaphore
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AsyncMutex(maxWaiters: Int)(implicit arg0: MonadAsync[F], arg1: Monad[F], arg2: Catchable[F])

    Permalink

    Constructs a mutex with maxWaiters as the limit on the number of waiters for permits.

  2. new AsyncMutex()(implicit arg0: MonadAsync[F], arg1: Monad[F], arg2: Catchable[F])

    Permalink

    Constructs a mutex with no limit on the max number of waiters for permits.

  3. new AsyncMutex(maxWaiters: Option[Int])(implicit arg0: MonadAsync[F], arg1: Monad[F], arg2: Catchable[F])

    Permalink
    Attributes
    protected

Type Members

  1. final class SemaphorePermit extends Permit

    Permalink
    Definition Classes
    AsyncSemaphore

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def acquire(): F[Permit]

    Permalink

    Acquire a Permit, asynchronously.

    Acquire a Permit, asynchronously. Be sure to permit.release() in a 'finally' block of your onSuccess() callback.

    Interrupting this future is only advisory, and will not release the permit if the future has already been satisfied.

    returns

    a Future[Permit] when the Future is satisfied, computation can proceed, or a Future.Exception[RejectedExecutionException] if the configured maximum number of waitq would be exceeded.

    Definition Classes
    AsyncSemaphore
  5. def acquireAndRun[T](func: ⇒ F[T]): F[T]

    Permalink

    Execute the function asynchronously when a permit becomes available.

    Execute the function asynchronously when a permit becomes available.

    If the function throws a non-fatal exception, the exception is returned as part of the Future. For all exceptions, the permit would be released before returning.

    returns

    a Future[T] equivalent to the return value of the input function. If the configured maximum value of waitq is reached, Future.Exception[RejectedExecutionException] is returned.

    Definition Classes
    AsyncSemaphore
  6. def acquireAndRunSync[T](func: ⇒ T): F[T]

    Permalink

    Execute the function when a permit becomes available.

    Execute the function when a permit becomes available.

    If the function throws an exception, the exception is returned as part of the Future. For all exceptions, the permit would be released before returning.

    returns

    a Future[T] equivalent to the return value of the input function. If the configured maximum value of waitq is reached, Future.Exception[RejectedExecutionException] is returned.

    Definition Classes
    AsyncSemaphore
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def numInitialPermits: Int

    Permalink
    Definition Classes
    AsyncSemaphore
  19. def numPermitsAvailable: Int

    Permalink
    Definition Classes
    AsyncSemaphore
  20. def numWaiters: Int

    Permalink
    Definition Classes
    AsyncSemaphore
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AsyncSemaphore[F]

Inherited from AnyRef

Inherited from Any

Ungrouped