trait PotActionRetriable[A, P <: PotActionRetriable[A, P]] extends PotAction[A, P] with AsyncActionRetriable[A, P]
A retriable async action handler for Pot values. Combines the state and result of AsyncAction into a single
Pot value.
- A
Type of action result
- P
Type of the actual action class
- Alphabetic
- By Inheritance
- PotActionRetriable
- AsyncActionRetriable
- PotAction
- AsyncAction
- Action
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
implicit
object
PActionType extends ActionType[P]
- Definition Classes
- AsyncAction
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
effect[B](f: ⇒ Future[B])(success: (B) ⇒ A, failure: (Throwable) ⇒ Throwable = identity)(implicit ec: ExecutionContext): EffectSingle[P]
Wraps a by-name future result into an effect using success and failure transformations.
Wraps a by-name future result into an effect using success and failure transformations.
- f
Future to wrap, passes using by-name (lazy evaluation)
- success
Transformation function for success case
- failure
Transformation function for failure case
- returns
An
Effectfor running the providedFuture
- Definition Classes
- AsyncAction
-
def
effectWithRetry[B](f: ⇒ Future[B])(success: (B) ⇒ A, failure: (Throwable) ⇒ Throwable = identity)(implicit ec: ExecutionContext): (RetryPolicy) ⇒ EffectSingle[P]
Wraps a by-name future result into an effect creator function, using success and failure transformations.
Wraps a by-name future result into an effect creator function, using success and failure transformations.
- f
Future to wrap, passes using by-name (lazy evaluation)
- success
Transformation function for success case
- failure
Transformation function for failure case
- returns
An
Effectfor running the providedFuture
- Definition Classes
- AsyncActionRetriable
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
failed(ex: Throwable, nextRetryPolicy: RetryPolicy = retryPolicy): P
Moves this action to a failed state with the provided exception.
Moves this action to a failed state with the provided exception.
- ex
Exception describing the reason for failure
- nextRetryPolicy
Updated retry policy
- Definition Classes
- AsyncActionRetriable
-
def
failed(ex: Throwable): P
Moves this action to a failed state with the provided exception.
Moves this action to a failed state with the provided exception.
- ex
Reason for the failure.
- Definition Classes
- AsyncAction
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
handle[M](pf: PartialFunction[PotState, ActionResult[M]]): ActionResult[M]
Handles the action using the supplied partial function matching current state.
Handles the action using the supplied partial function matching current state.
- Definition Classes
- AsyncAction
-
def
handleWith[M, T](handler: ActionHandler[M, T], effectRetry: (RetryPolicy) ⇒ Effect)(f: (PotActionRetriable.this.type, ActionHandler[M, T], (RetryPolicy) ⇒ Effect) ⇒ ActionResult[M]): ActionResult[M]
Handles the action using an external handler function.
Handles the action using an external handler function. The function is provided with instance of this
AsyncAction, theActionHandlerthis action currently resides in and the provided updateEffectcreator function. The reason why retry policy is provided to the effect creator is that in case of failure, the updated retry policy can be passed on to the next effect instantiation.- handler
The current action handler instance.
- effectRetry
Function taking current
RetryPolicyand returning an effect that performs the requested async operation.- f
External handler function
- returns
An action result
- Definition Classes
- AsyncActionRetriable
-
def
handleWith[M, T](handler: ActionHandler[M, T], effect: Effect)(f: (PotActionRetriable.this.type, ActionHandler[M, T], Effect) ⇒ ActionResult[M]): ActionResult[M]
Handles the action using an external handler function.
Handles the action using an external handler function. The function is provided with instance of this
AsyncAction, theActionHandlerthis action currently resides in and the provided updateEffect.- handler
The current action handler instance.
- effect
Effect that performs the requested async operation.
- f
External handler function
- returns
An action result
- Definition Classes
- AsyncAction
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
next(newState: PotState, newValue: Try[A], newRetryPolicy: RetryPolicy): P
- Definition Classes
- PotActionRetriable → AsyncActionRetriable
-
def
next(newValue: Pot[A]): P
- Definition Classes
- PotActionRetriable → PotAction
-
def
next(newState: PotState, newValue: Try[A]): P
Moves the action to the next state.
Moves the action to the next state.
- newState
New state for the action
- newValue
New value for the action
- returns
A new instance of this action with updated state and value
- Definition Classes
- AsyncActionRetriable → AsyncAction
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
pending: P
Moves this action to pending state.
Moves this action to pending state.
- Definition Classes
- AsyncAction
-
def
ready(a: A): P
Moves this action to ready state with a result value.
Moves this action to ready state with a result value.
- a
Result for the action.
- Definition Classes
- AsyncAction
-
def
result: Try[A]
- Definition Classes
- PotAction → AsyncAction
-
def
state: PotState
- Definition Classes
- PotAction → AsyncAction
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()