monadasync

AsyncSemaphore

class AsyncSemaphore[F[_]] extends AnyRef

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AsyncSemaphore
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

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

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

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

    initialPermits

    must be positive

    maxWaiters

    must be non-negative

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

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

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

    initialPermits

    must be positive

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

    Attributes
    protected

Type Members

  1. final class SemaphorePermit extends Permit

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def acquire(): F[Permit]

    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.

  7. def acquireAndRun[T](func: ⇒ F[T]): F[T]

    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.

  8. def acquireAndRunSync[T](func: ⇒ T): F[T]

    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.

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def numInitialPermits: Int

  21. def numPermitsAvailable: Int

  22. def numWaiters: Int

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  24. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped