final case class Activity[-Input, Result](name: String, description: String, operation: Operation[Input, Result], check: ZFlow[Input, ActivityError, Result], compensate: ZFlow[Result, ActivityError, Unit]) extends Product with Serializable
Activity is a special step for a zio-flow workflow capable of communicating with the external world via an Operation.
When calling an activity from a workflow, a value of type Input must be provided, and the result of successfully executing an activity has the type Result.
An activity can be reverted when it is being called from a transaction. If the transaction get reverted (due to a failure or a retry) the compensate flow can perform an arbitrary number of steps necessary to cancel whatever the activity has done. If this is not supported, use Activity.compensateNotSupported.
The check flow can be used to perform steps verifying if the activity still needed to be executed. In case it was restarted by a transaction or because the whole workflow executor got restarted, this feature can be used to make sure the operation was only executed exactly once. If this is not supported, use Activity.checkNotSupported.
- Self Type
- Activity[Input, Result]
- Alphabetic
- By Inheritance
- Activity
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Activity(name: String, description: String, operation: Operation[Input, Result], check: ZFlow[Input, ActivityError, Result], compensate: ZFlow[Result, ActivityError, Unit])
Value Members
-
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
-
def
apply[I1, I2, I3, I4, I5, I6](input1: Remote[I1], input2: Remote[I2], input3: Remote[I3], input4: Remote[I4], input5: Remote[I5], input6: Remote[I6])(implicit ev: <:<[(I1, I2, I3, I4, I5, I6), Input]): ZFlow[Any, ActivityError, Result]
Execute this activity with the given inputs
-
def
apply[I1, I2, I3, I4, I5](input1: Remote[I1], input2: Remote[I2], input3: Remote[I3], input4: Remote[I4], input5: Remote[I5])(implicit ev: <:<[(I1, I2, I3, I4, I5), Input]): ZFlow[Any, ActivityError, Result]
Execute this activity with the given inputs
-
def
apply[I1, I2, I3, I4](input1: Remote[I1], input2: Remote[I2], input3: Remote[I3], input4: Remote[I4])(implicit ev: <:<[(I1, I2, I3, I4), Input]): ZFlow[Any, ActivityError, Result]
Execute this activity with the given inputs
-
def
apply[I1, I2, I3](input1: Remote[I1], input2: Remote[I2], input3: Remote[I3])(implicit ev: <:<[(I1, I2, I3), Input]): ZFlow[Any, ActivityError, Result]
Execute this activity with the given inputs
-
def
apply[I1, I2](input1: Remote[I1], input2: Remote[I2])(implicit ev: <:<[(I1, I2), Input]): ZFlow[Any, ActivityError, Result]
Execute this activity with the given inputs
-
def
apply(input: Remote[Input]): ZFlow[Any, ActivityError, Result]
Execute this activity with the given input
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val check: ZFlow[Input, ActivityError, Result]
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val compensate: ZFlow[Result, ActivityError, Unit]
-
def
contramap[Input2](from: (Remote[Input2]) ⇒ Remote[Input])(implicit arg0: Schema[Input2]): Activity[Input2, Result]
Defines an activity that performs the same operations but its input is transformed by the given function.
- val description: String
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fromInput: ZFlow[Input, ActivityError, Result]
Executes this activity by requiring its input to be the flow's input.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val inputSchema: Schema[_ >: Input]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
mapResult[Result2](to: (Remote[Result]) ⇒ Remote[Result2], from: (Remote[Result2]) ⇒ Remote[Result])(implicit arg0: Schema[Result2]): Activity[Input, Result2]
Defines an activity that performs the same operations but its result is transformed by the given function 'to'.
Defines an activity that performs the same operations but its result is transformed by the given function 'to'.
Another function 'from' must also be specified which is used to convert back the result in order to pass it to the original 'compensate' flow.
- val name: String
-
def
narrow[Input0](implicit ev: <:<[Input0, Input]): Activity[Input0, Result]
Narrows the input type of this activity
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val operation: Operation[Input, Result]
- val resultSchema: Schema[_ <: Result]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
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()