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]
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Activity
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Activity(name: String, description: String, operation: Operation[Input, Result], check: ZFlow[Input, ActivityError, Result], compensate: ZFlow[Result, ActivityError, Unit])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. 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

  5. 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

  6. 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

  7. 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

  8. 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

  9. def apply(input: Remote[Input]): ZFlow[Any, ActivityError, Result]

    Execute this activity with the given input

  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. val check: ZFlow[Input, ActivityError, Result]
  12. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  13. val compensate: ZFlow[Result, ActivityError, Unit]
  14. 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.

  15. val description: String
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def fromInput: ZFlow[Input, ActivityError, Result]

    Executes this activity by requiring its input to be the flow's input.

  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. val inputSchema: Schema[_ >: Input]
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. 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.

  23. val name: String
  24. def narrow[Input0](implicit ev: <:<[Input0, Input]): Activity[Input0, Result]

    Narrows the input type of this activity

  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. val operation: Operation[Input, Result]
  29. val resultSchema: Schema[_ <: Result]
  30. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped