AddWorkflowAspectDsl

zio.temporal.worker.ZWorker.AddWorkflowAspectDsl
final class AddWorkflowAspectDsl[I]

Allows building workers using ZIOAspect

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

inline def from[Workflow <: I](inline f: => Workflow)(implicit ctg: ClassTag[I]): Add[Nothing, Any]

Configures a factory to use when an instance of a workflow implementation is created. The only valid use for this method is unit testing, specifically to instantiate mocks that implement child workflows. An example of mocking a child workflow:

Configures a factory to use when an instance of a workflow implementation is created. The only valid use for this method is unit testing, specifically to instantiate mocks that implement child workflows. An example of mocking a child workflow:

Type parameters

Workflow

workflow interface implementation

Value parameters

ctg

workflow interface class tag

f

should create a workflow implementation

Attributes

See also

Worker#addWorkflowImplementationFactory

inline def from(cls: Class[I], f: () => I): Add[Nothing, Any]

Configures a factory to use when an instance of a workflow implementation is created. The only valid use for this method is unit testing, specifically to instantiate mocks that implement child workflows. An example of mocking a child workflow:

Configures a factory to use when an instance of a workflow implementation is created. The only valid use for this method is unit testing, specifically to instantiate mocks that implement child workflows. An example of mocking a child workflow:

Value parameters

cls

workflow interface class

f

should create a workflow implementation

Attributes

See also

Worker#addWorkflowImplementationFactory

inline def fromClass(implicit ctg: ClassTag[I], isConcreteClass: IsConcreteClass[I], hasPublicNullaryConstructor: HasPublicNullaryConstructor[I]): Add[Nothing, Any]

Registers workflow implementation classes with a worker. Can be called multiple times to add more types.

Registers workflow implementation classes with a worker. Can be called multiple times to add more types.

Auto-registration: the aspect's public call site (ZWorker.addWorkflow[I].fromClass) always has a concrete I, so we auto-register I's codecs inside the aspect's flatMap — where the worker is available — by going through the (inline) worker.addWorkflow[I] method. Making fromClass itself inline keeps the macro expansion visible at the user's concrete call site instead of inside this generic class's compilation.

Value parameters

ctg

workflow interface class tag

Attributes

See also

Worker#registerWorkflowImplementationTypes

inline def fromClass(cls: Class[I])(implicit isConcreteClass: IsConcreteClass[I], hasPublicNullaryConstructor: HasPublicNullaryConstructor[I]): Add[Nothing, Any]

Registers workflow implementation classes with a worker. Can be called multiple times to add more types.

Registers workflow implementation classes with a worker. Can be called multiple times to add more types.

Value parameters

cls

workflow interface class tag

Attributes

See also

Worker#registerWorkflowImplementationTypes

Specifies workflow implementation options for the worker

Specifies workflow implementation options for the worker

Value parameters

value

custom workflow implementation options for a worker

Attributes