tasker-engine 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +22 -0
- data/README.md +443 -0
- data/Rakefile +10 -0
- data/app/controllers/tasker/analytics_controller.rb +179 -0
- data/app/controllers/tasker/application_controller.rb +45 -0
- data/app/controllers/tasker/graphql_controller.rb +193 -0
- data/app/controllers/tasker/handlers_controller.rb +217 -0
- data/app/controllers/tasker/health_controller.rb +229 -0
- data/app/controllers/tasker/metrics_controller.rb +111 -0
- data/app/controllers/tasker/page_sort.rb +97 -0
- data/app/controllers/tasker/task_diagrams_controller.rb +30 -0
- data/app/controllers/tasker/tasks_controller.rb +123 -0
- data/app/controllers/tasker/workflow_steps_controller.rb +69 -0
- data/app/graphql/examples/all_tasks.graphql +22 -0
- data/app/graphql/examples/pending_tasks.graphql +23 -0
- data/app/graphql/tasker/graph_ql_types/annotation_type.rb +14 -0
- data/app/graphql/tasker/graph_ql_types/base_argument.rb +9 -0
- data/app/graphql/tasker/graph_ql_types/base_connection.rb +11 -0
- data/app/graphql/tasker/graph_ql_types/base_edge.rb +10 -0
- data/app/graphql/tasker/graph_ql_types/base_enum.rb +9 -0
- data/app/graphql/tasker/graph_ql_types/base_field.rb +10 -0
- data/app/graphql/tasker/graph_ql_types/base_input_object.rb +10 -0
- data/app/graphql/tasker/graph_ql_types/base_interface.rb +14 -0
- data/app/graphql/tasker/graph_ql_types/base_object.rb +10 -0
- data/app/graphql/tasker/graph_ql_types/base_scalar.rb +9 -0
- data/app/graphql/tasker/graph_ql_types/base_union.rb +11 -0
- data/app/graphql/tasker/graph_ql_types/dependent_system_object_map_type.rb +18 -0
- data/app/graphql/tasker/graph_ql_types/dependent_system_type.rb +13 -0
- data/app/graphql/tasker/graph_ql_types/mutation_type.rb +16 -0
- data/app/graphql/tasker/graph_ql_types/named_step_type.rb +16 -0
- data/app/graphql/tasker/graph_ql_types/named_task_type.rb +14 -0
- data/app/graphql/tasker/graph_ql_types/named_tasks_named_step_type.rb +19 -0
- data/app/graphql/tasker/graph_ql_types/node_type.rb +12 -0
- data/app/graphql/tasker/graph_ql_types/query_type.rb +20 -0
- data/app/graphql/tasker/graph_ql_types/task_annotation_type.rb +17 -0
- data/app/graphql/tasker/graph_ql_types/task_interface.rb +17 -0
- data/app/graphql/tasker/graph_ql_types/task_type.rb +26 -0
- data/app/graphql/tasker/graph_ql_types/workflow_step_type.rb +154 -0
- data/app/graphql/tasker/graph_ql_types.rb +42 -0
- data/app/graphql/tasker/mutations/base_mutation.rb +13 -0
- data/app/graphql/tasker/mutations/cancel_step.rb +29 -0
- data/app/graphql/tasker/mutations/cancel_task.rb +29 -0
- data/app/graphql/tasker/mutations/create_task.rb +52 -0
- data/app/graphql/tasker/mutations/update_step.rb +36 -0
- data/app/graphql/tasker/mutations/update_task.rb +41 -0
- data/app/graphql/tasker/queries/all_annotation_types.rb +17 -0
- data/app/graphql/tasker/queries/all_tasks.rb +23 -0
- data/app/graphql/tasker/queries/base_query.rb +9 -0
- data/app/graphql/tasker/queries/helpers.rb +16 -0
- data/app/graphql/tasker/queries/one_step.rb +24 -0
- data/app/graphql/tasker/queries/one_task.rb +18 -0
- data/app/graphql/tasker/queries/tasks_by_annotation.rb +31 -0
- data/app/graphql/tasker/queries/tasks_by_status.rb +30 -0
- data/app/graphql/tasker/tasker_rails_schema.rb +52 -0
- data/app/jobs/tasker/application_job.rb +8 -0
- data/app/jobs/tasker/metrics_export_job.rb +252 -0
- data/app/jobs/tasker/task_runner_job.rb +224 -0
- data/app/models/tasker/annotation_type.rb +26 -0
- data/app/models/tasker/application_record.rb +70 -0
- data/app/models/tasker/dependent_system.rb +26 -0
- data/app/models/tasker/dependent_system_object_map.rb +64 -0
- data/app/models/tasker/diagram/edge.rb +106 -0
- data/app/models/tasker/diagram/flowchart.rb +137 -0
- data/app/models/tasker/diagram/node.rb +99 -0
- data/app/models/tasker/named_step.rb +41 -0
- data/app/models/tasker/named_task.rb +121 -0
- data/app/models/tasker/named_tasks_named_step.rb +82 -0
- data/app/models/tasker/step_dag_relationship.rb +65 -0
- data/app/models/tasker/step_readiness_status.rb +59 -0
- data/app/models/tasker/task.rb +424 -0
- data/app/models/tasker/task_annotation.rb +36 -0
- data/app/models/tasker/task_diagram.rb +332 -0
- data/app/models/tasker/task_execution_context.rb +29 -0
- data/app/models/tasker/task_namespace.rb +41 -0
- data/app/models/tasker/task_transition.rb +235 -0
- data/app/models/tasker/workflow_step.rb +461 -0
- data/app/models/tasker/workflow_step_edge.rb +94 -0
- data/app/models/tasker/workflow_step_transition.rb +434 -0
- data/app/serializers/tasker/annotation_type_serializer.rb +8 -0
- data/app/serializers/tasker/handler_serializer.rb +109 -0
- data/app/serializers/tasker/task_annotation_serializer.rb +32 -0
- data/app/serializers/tasker/task_serializer.rb +168 -0
- data/app/serializers/tasker/workflow_step_serializer.rb +27 -0
- data/app/services/tasker/analytics_service.rb +409 -0
- data/app/views/tasker/task/_diagram.html.erb +32 -0
- data/config/initializers/dry_struct.rb +11 -0
- data/config/initializers/statesman.rb +6 -0
- data/config/initializers/tasker_orchestration.rb +17 -0
- data/config/initializers/time_formats.rb +4 -0
- data/config/routes.rb +34 -0
- data/config/tasker/subscriptions/example_integrations.yml +67 -0
- data/config/tasker/system_events.yml +305 -0
- data/db/functions/calculate_dependency_levels_v01.sql +45 -0
- data/db/functions/get_analytics_metrics_v01.sql +137 -0
- data/db/functions/get_slowest_steps_v01.sql +82 -0
- data/db/functions/get_slowest_tasks_v01.sql +96 -0
- data/db/functions/get_step_readiness_status_batch_v01.sql +140 -0
- data/db/functions/get_step_readiness_status_v01.sql +139 -0
- data/db/functions/get_system_health_counts_v01.sql +108 -0
- data/db/functions/get_task_execution_context_v01.sql +108 -0
- data/db/functions/get_task_execution_contexts_batch_v01.sql +104 -0
- data/db/init/schema.sql +2277 -0
- data/db/migrate/20250701165431_initial_tasker_schema.rb +116 -0
- data/db/views/tasker_step_dag_relationships_v01.sql +69 -0
- data/docs/APPLICATION_GENERATOR.md +384 -0
- data/docs/AUTH.md +1780 -0
- data/docs/CIRCUIT_BREAKER.md +224 -0
- data/docs/DEVELOPER_GUIDE.md +2665 -0
- data/docs/EVENT_SYSTEM.md +637 -0
- data/docs/EXECUTION_CONFIGURATION.md +341 -0
- data/docs/FLOW_CHART.md +149 -0
- data/docs/HEALTH.md +542 -0
- data/docs/METRICS.md +731 -0
- data/docs/OPTIMIZATION_PLAN.md +1479 -0
- data/docs/OVERVIEW.md +552 -0
- data/docs/QUICK_START.md +270 -0
- data/docs/REGISTRY_SYSTEMS.md +373 -0
- data/docs/REST_API.md +632 -0
- data/docs/ROADMAP.md +221 -0
- data/docs/SQL_FUNCTIONS.md +1408 -0
- data/docs/TASK_DIAGRAM.md +252 -0
- data/docs/TASK_EXECUTION_CONTROL_FLOW.md +237 -0
- data/docs/TELEMETRY.md +795 -0
- data/docs/TROUBLESHOOTING.md +756 -0
- data/docs/TaskHandlerGenerator.html +255 -0
- data/docs/Tasker/Analysis/RuntimeGraphAnalyzer.html +907 -0
- data/docs/Tasker/Analysis/TemplateGraphAnalyzer.html +1236 -0
- data/docs/Tasker/Analysis.html +117 -0
- data/docs/Tasker/AnalyticsController.html +450 -0
- data/docs/Tasker/AnalyticsService/BottleneckAnalytics.html +816 -0
- data/docs/Tasker/AnalyticsService/PerformanceAnalytics.html +586 -0
- data/docs/Tasker/AnalyticsService.html +2221 -0
- data/docs/Tasker/AnnotationType.html +137 -0
- data/docs/Tasker/AnnotationTypeSerializer.html +124 -0
- data/docs/Tasker/ApplicationController.html +147 -0
- data/docs/Tasker/ApplicationJob.html +128 -0
- data/docs/Tasker/ApplicationRecord.html +378 -0
- data/docs/Tasker/Authentication/AuthenticationError.html +124 -0
- data/docs/Tasker/Authentication/ConfigurationError.html +124 -0
- data/docs/Tasker/Authentication/Coordinator.html +242 -0
- data/docs/Tasker/Authentication/Interface.html +560 -0
- data/docs/Tasker/Authentication/InterfaceError.html +124 -0
- data/docs/Tasker/Authentication/NoneAuthenticator.html +338 -0
- data/docs/Tasker/Authentication.html +119 -0
- data/docs/Tasker/Authorization/AuthorizationError.html +139 -0
- data/docs/Tasker/Authorization/BaseCoordinator.html +927 -0
- data/docs/Tasker/Authorization/ConfigurationError.html +153 -0
- data/docs/Tasker/Authorization/ResourceConstants/ACTIONS.html +428 -0
- data/docs/Tasker/Authorization/ResourceConstants/RESOURCES.html +365 -0
- data/docs/Tasker/Authorization/ResourceConstants.html +146 -0
- data/docs/Tasker/Authorization/ResourceRegistry.html +882 -0
- data/docs/Tasker/Authorization/UnauthorizedError.html +153 -0
- data/docs/Tasker/Authorization.html +582 -0
- data/docs/Tasker/CacheCapabilities.html +167 -0
- data/docs/Tasker/CacheStrategy.html +1297 -0
- data/docs/Tasker/Concerns/Authenticatable.html +116 -0
- data/docs/Tasker/Concerns/Authorizable/AdminStatusChecker.html +256 -0
- data/docs/Tasker/Concerns/Authorizable.html +816 -0
- data/docs/Tasker/Concerns/ControllerAuthorizable.html +157 -0
- data/docs/Tasker/Concerns/EventPublisher.html +4023 -0
- data/docs/Tasker/Concerns/IdempotentStateTransitions.html +806 -0
- data/docs/Tasker/Concerns/LifecycleEventHelpers.html +129 -0
- data/docs/Tasker/Concerns/OrchestrationPublisher.html +129 -0
- data/docs/Tasker/Concerns/StateMachineBase/ClassMethods.html +1075 -0
- data/docs/Tasker/Concerns/StateMachineBase/StateMachineBase/ClassMethods.html +191 -0
- data/docs/Tasker/Concerns/StateMachineBase/StateMachineBase.html +126 -0
- data/docs/Tasker/Concerns/StateMachineBase.html +153 -0
- data/docs/Tasker/Concerns/StructuredLogging.html +1413 -0
- data/docs/Tasker/Concerns.html +117 -0
- data/docs/Tasker/Configuration/AuthConfiguration.html +1023 -0
- data/docs/Tasker/Configuration/ConfigurationProxy.html +581 -0
- data/docs/Tasker/Configuration/DatabaseConfiguration.html +475 -0
- data/docs/Tasker/Configuration/EngineConfiguration.html +1265 -0
- data/docs/Tasker/Configuration/HealthConfiguration.html +791 -0
- data/docs/Tasker/Configuration/TelemetryConfiguration.html +1308 -0
- data/docs/Tasker/Configuration/TelemetryConfigurationProxy.html +388 -0
- data/docs/Tasker/Configuration.html +1669 -0
- data/docs/Tasker/ConfigurationError.html +143 -0
- data/docs/Tasker/ConfiguredTask.html +514 -0
- data/docs/Tasker/Constants/EventDefinitions.html +590 -0
- data/docs/Tasker/Constants/LifecycleEvents.html +137 -0
- data/docs/Tasker/Constants/ObservabilityEvents/Step.html +152 -0
- data/docs/Tasker/Constants/ObservabilityEvents/Task.html +142 -0
- data/docs/Tasker/Constants/ObservabilityEvents.html +126 -0
- data/docs/Tasker/Constants/RegistryEvents.html +285 -0
- data/docs/Tasker/Constants/StepEvents.html +177 -0
- data/docs/Tasker/Constants/TaskEvents.html +167 -0
- data/docs/Tasker/Constants/TaskExecution/ExecutionStatus.html +207 -0
- data/docs/Tasker/Constants/TaskExecution/HealthStatus.html +191 -0
- data/docs/Tasker/Constants/TaskExecution/RecommendedAction.html +207 -0
- data/docs/Tasker/Constants/TaskExecution.html +126 -0
- data/docs/Tasker/Constants/TaskFinalization/ErrorMessages.html +132 -0
- data/docs/Tasker/Constants/TaskFinalization/PendingReasons.html +207 -0
- data/docs/Tasker/Constants/TaskFinalization/ReenqueueReasons.html +239 -0
- data/docs/Tasker/Constants/TaskFinalization.html +126 -0
- data/docs/Tasker/Constants/TaskStatuses.html +223 -0
- data/docs/Tasker/Constants/TestEvents.html +163 -0
- data/docs/Tasker/Constants/WorkflowEvents.html +222 -0
- data/docs/Tasker/Constants/WorkflowStepStatuses.html +223 -0
- data/docs/Tasker/Constants.html +561 -0
- data/docs/Tasker/DependentSystem.html +137 -0
- data/docs/Tasker/DependentSystemObjectMap.html +250 -0
- data/docs/Tasker/DetectorRegistry.html +598 -0
- data/docs/Tasker/Diagram/Edge.html +1191 -0
- data/docs/Tasker/Diagram/Flowchart.html +1539 -0
- data/docs/Tasker/Diagram/Node.html +1165 -0
- data/docs/Tasker/Diagram.html +117 -0
- data/docs/Tasker/Engine.html +215 -0
- data/docs/Tasker/Error.html +139 -0
- data/docs/Tasker/Events/Bus.html +1226 -0
- data/docs/Tasker/Events/Catalog/CatalogPrinter.html +258 -0
- data/docs/Tasker/Events/Catalog/CustomEventRegistrar.html +276 -0
- data/docs/Tasker/Events/Catalog/ExamplePayloadGenerator.html +294 -0
- data/docs/Tasker/Events/Catalog.html +1291 -0
- data/docs/Tasker/Events/CustomRegistry.html +943 -0
- data/docs/Tasker/Events/DefinitionLoader.html +575 -0
- data/docs/Tasker/Events/EventPayloadBuilder/ErrorInfoExtractor.html +286 -0
- data/docs/Tasker/Events/EventPayloadBuilder/StepPayloadBuilder.html +312 -0
- data/docs/Tasker/Events/EventPayloadBuilder.html +664 -0
- data/docs/Tasker/Events/Publisher.html +365 -0
- data/docs/Tasker/Events/Subscribers/BaseSubscriber/ErrorCategorizer/ErrorTypeClassifier.html +1128 -0
- data/docs/Tasker/Events/Subscribers/BaseSubscriber/ErrorCategorizer.html +270 -0
- data/docs/Tasker/Events/Subscribers/BaseSubscriber/MetricTagsExtractor.html +266 -0
- data/docs/Tasker/Events/Subscribers/BaseSubscriber.html +2556 -0
- data/docs/Tasker/Events/Subscribers/MetricsSubscriber.html +723 -0
- data/docs/Tasker/Events/Subscribers/TelemetrySubscriber.html +2251 -0
- data/docs/Tasker/Events/Subscribers.html +117 -0
- data/docs/Tasker/Events/SubscriptionLoader.html +493 -0
- data/docs/Tasker/Events.html +294 -0
- data/docs/Tasker/EventsGenerator.html +459 -0
- data/docs/Tasker/Functions/FunctionBasedAnalyticsMetrics/AnalyticsMetrics.html +135 -0
- data/docs/Tasker/Functions/FunctionBasedAnalyticsMetrics.html +412 -0
- data/docs/Tasker/Functions/FunctionBasedDependencyLevels.html +598 -0
- data/docs/Tasker/Functions/FunctionBasedSlowestSteps/SlowestStep.html +135 -0
- data/docs/Tasker/Functions/FunctionBasedSlowestSteps.html +453 -0
- data/docs/Tasker/Functions/FunctionBasedSlowestTasks/SlowestTask.html +135 -0
- data/docs/Tasker/Functions/FunctionBasedSlowestTasks.html +453 -0
- data/docs/Tasker/Functions/FunctionBasedStepReadinessStatus.html +1457 -0
- data/docs/Tasker/Functions/FunctionBasedSystemHealthCounts/HealthMetrics.html +135 -0
- data/docs/Tasker/Functions/FunctionBasedSystemHealthCounts.html +370 -0
- data/docs/Tasker/Functions/FunctionBasedTaskExecutionContext.html +1250 -0
- data/docs/Tasker/Functions/FunctionWrapper.html +479 -0
- data/docs/Tasker/Functions.html +117 -0
- data/docs/Tasker/Generators/AuthenticatorGenerator/UsageInstructionsFormatter.html +244 -0
- data/docs/Tasker/Generators/AuthenticatorGenerator.html +373 -0
- data/docs/Tasker/Generators/AuthorizationCoordinatorGenerator.html +430 -0
- data/docs/Tasker/Generators/SubscriberGenerator.html +377 -0
- data/docs/Tasker/Generators/TaskHandlerGenerator.html +263 -0
- data/docs/Tasker/Generators.html +117 -0
- data/docs/Tasker/GraphQLTypes/AnnotationType.html +132 -0
- data/docs/Tasker/GraphQLTypes/BaseArgument.html +124 -0
- data/docs/Tasker/GraphQLTypes/BaseConnection.html +124 -0
- data/docs/Tasker/GraphQLTypes/BaseEdge.html +130 -0
- data/docs/Tasker/GraphQLTypes/BaseEnum.html +124 -0
- data/docs/Tasker/GraphQLTypes/BaseField.html +124 -0
- data/docs/Tasker/GraphQLTypes/BaseInputObject.html +124 -0
- data/docs/Tasker/GraphQLTypes/BaseInterface.html +116 -0
- data/docs/Tasker/GraphQLTypes/BaseObject.html +128 -0
- data/docs/Tasker/GraphQLTypes/BaseScalar.html +124 -0
- data/docs/Tasker/GraphQLTypes/BaseUnion.html +124 -0
- data/docs/Tasker/GraphQLTypes/DependentSystemObjectMapType.html +132 -0
- data/docs/Tasker/GraphQLTypes/DependentSystemType.html +132 -0
- data/docs/Tasker/GraphQLTypes/MutationType.html +132 -0
- data/docs/Tasker/GraphQLTypes/NamedStepType.html +132 -0
- data/docs/Tasker/GraphQLTypes/NamedTaskType.html +132 -0
- data/docs/Tasker/GraphQLTypes/NamedTasksNamedStepType.html +132 -0
- data/docs/Tasker/GraphQLTypes/NodeType.html +118 -0
- data/docs/Tasker/GraphQLTypes/QueryType.html +139 -0
- data/docs/Tasker/GraphQLTypes/TaskAnnotationType.html +132 -0
- data/docs/Tasker/GraphQLTypes/TaskInterface.html +111 -0
- data/docs/Tasker/GraphQLTypes/TaskType.html +201 -0
- data/docs/Tasker/GraphQLTypes/WorkflowStepType.html +694 -0
- data/docs/Tasker/GraphQLTypes.html +130 -0
- data/docs/Tasker/GraphqlController.html +251 -0
- data/docs/Tasker/HandlerFactory.html +1518 -0
- data/docs/Tasker/HandlerSerializer.html +682 -0
- data/docs/Tasker/HandlersController.html +574 -0
- data/docs/Tasker/HashIdentityStrategy.html +278 -0
- data/docs/Tasker/Health/ReadinessChecker.html +712 -0
- data/docs/Tasker/Health/StatusChecker.html +653 -0
- data/docs/Tasker/Health.html +117 -0
- data/docs/Tasker/HealthController.html +523 -0
- data/docs/Tasker/IdentityStrategy.html +276 -0
- data/docs/Tasker/InvalidTaskHandlerConfig.html +135 -0
- data/docs/Tasker/LifecycleEvents/Events/Step.html +162 -0
- data/docs/Tasker/LifecycleEvents/Events/Task.html +162 -0
- data/docs/Tasker/LifecycleEvents/Events.html +204 -0
- data/docs/Tasker/LifecycleEvents/Publisher.html +132 -0
- data/docs/Tasker/LifecycleEvents.html +799 -0
- data/docs/Tasker/Logging/CorrelationIdGenerator.html +688 -0
- data/docs/Tasker/Logging.html +115 -0
- data/docs/Tasker/MetricsController.html +293 -0
- data/docs/Tasker/MetricsExportJob.html +414 -0
- data/docs/Tasker/Mutations/BaseMutation.html +128 -0
- data/docs/Tasker/Mutations/CancelStep.html +219 -0
- data/docs/Tasker/Mutations/CancelTask.html +221 -0
- data/docs/Tasker/Mutations/CreateTask.html +243 -0
- data/docs/Tasker/Mutations/UpdateStep.html +243 -0
- data/docs/Tasker/Mutations/UpdateTask.html +243 -0
- data/docs/Tasker/Mutations.html +117 -0
- data/docs/Tasker/NamedStep.html +216 -0
- data/docs/Tasker/NamedTask.html +910 -0
- data/docs/Tasker/NamedTasksNamedStep.html +435 -0
- data/docs/Tasker/Orchestration/BackoffCalculator.html +404 -0
- data/docs/Tasker/Orchestration/ConnectionBuilder/ConfigValidator.html +258 -0
- data/docs/Tasker/Orchestration/ConnectionBuilder.html +435 -0
- data/docs/Tasker/Orchestration/ConnectionPoolIntelligence.html +513 -0
- data/docs/Tasker/Orchestration/Coordinator.html +641 -0
- data/docs/Tasker/Orchestration/FutureStateAnalyzer.html +1045 -0
- data/docs/Tasker/Orchestration/Orchestrator.html +679 -0
- data/docs/Tasker/Orchestration/PluginIntegration.html +1127 -0
- data/docs/Tasker/Orchestration/ResponseProcessor.html +504 -0
- data/docs/Tasker/Orchestration/RetryHeaderParser.html +304 -0
- data/docs/Tasker/Orchestration/StepExecutor.html +995 -0
- data/docs/Tasker/Orchestration/StepSequenceFactory.html +644 -0
- data/docs/Tasker/Orchestration/TaskFinalizer/BlockageChecker.html +264 -0
- data/docs/Tasker/Orchestration/TaskFinalizer/ContextManager.html +254 -0
- data/docs/Tasker/Orchestration/TaskFinalizer/DelayCalculator.html +556 -0
- data/docs/Tasker/Orchestration/TaskFinalizer/FinalizationDecisionMaker.html +348 -0
- data/docs/Tasker/Orchestration/TaskFinalizer/FinalizationProcessor.html +286 -0
- data/docs/Tasker/Orchestration/TaskFinalizer/ReasonDeterminer.html +432 -0
- data/docs/Tasker/Orchestration/TaskFinalizer/ReenqueueManager.html +296 -0
- data/docs/Tasker/Orchestration/TaskFinalizer/UnclearStateHandler.html +314 -0
- data/docs/Tasker/Orchestration/TaskFinalizer.html +1212 -0
- data/docs/Tasker/Orchestration/TaskInitializer.html +766 -0
- data/docs/Tasker/Orchestration/TaskReenqueuer.html +506 -0
- data/docs/Tasker/Orchestration/ViableStepDiscovery.html +442 -0
- data/docs/Tasker/Orchestration/WorkflowCoordinator.html +510 -0
- data/docs/Tasker/Orchestration.html +130 -0
- data/docs/Tasker/PageSort/PageSortParamsBuilder.html +296 -0
- data/docs/Tasker/PageSort.html +247 -0
- data/docs/Tasker/PermanentError.html +518 -0
- data/docs/Tasker/ProceduralError.html +147 -0
- data/docs/Tasker/Queries/AllAnnotationTypes.html +217 -0
- data/docs/Tasker/Queries/AllTasks.html +221 -0
- data/docs/Tasker/Queries/BaseQuery.html +128 -0
- data/docs/Tasker/Queries/Helpers.html +187 -0
- data/docs/Tasker/Queries/OneStep.html +225 -0
- data/docs/Tasker/Queries/OneTask.html +217 -0
- data/docs/Tasker/Queries/TasksByAnnotation.html +231 -0
- data/docs/Tasker/Queries/TasksByStatus.html +233 -0
- data/docs/Tasker/Queries.html +119 -0
- data/docs/Tasker/Railtie.html +124 -0
- data/docs/Tasker/Registry/BaseRegistry.html +1690 -0
- data/docs/Tasker/Registry/EventPublisher.html +667 -0
- data/docs/Tasker/Registry/InterfaceValidator.html +569 -0
- data/docs/Tasker/Registry/RegistrationError.html +132 -0
- data/docs/Tasker/Registry/RegistryError.html +139 -0
- data/docs/Tasker/Registry/StatisticsCollector.html +841 -0
- data/docs/Tasker/Registry/SubscriberRegistry.html +1504 -0
- data/docs/Tasker/Registry/ValidationError.html +132 -0
- data/docs/Tasker/Registry.html +119 -0
- data/docs/Tasker/RetryableError.html +515 -0
- data/docs/Tasker/StateMachine/Compatibility.html +282 -0
- data/docs/Tasker/StateMachine/InvalidStateTransition.html +135 -0
- data/docs/Tasker/StateMachine/StepStateMachine/StandardizedPayloadBuilder.html +260 -0
- data/docs/Tasker/StateMachine/StepStateMachine.html +2215 -0
- data/docs/Tasker/StateMachine/TaskStateMachine.html +734 -0
- data/docs/Tasker/StateMachine.html +602 -0
- data/docs/Tasker/StepDagRelationship.html +657 -0
- data/docs/Tasker/StepHandler/Api/Config.html +1091 -0
- data/docs/Tasker/StepHandler/Api.html +884 -0
- data/docs/Tasker/StepHandler/AutomaticEventPublishing.html +321 -0
- data/docs/Tasker/StepHandler/Base.html +970 -0
- data/docs/Tasker/StepHandler.html +119 -0
- data/docs/Tasker/StepReadinessStatus.html +836 -0
- data/docs/Tasker/Task.html +2575 -0
- data/docs/Tasker/TaskAnnotation.html +137 -0
- data/docs/Tasker/TaskAnnotationSerializer.html +124 -0
- data/docs/Tasker/TaskBuilder/StepNameValidator.html +264 -0
- data/docs/Tasker/TaskBuilder/StepTemplateDefiner.html +264 -0
- data/docs/Tasker/TaskBuilder.html +764 -0
- data/docs/Tasker/TaskDiagram/StepToStepEdgeBuilder.html +260 -0
- data/docs/Tasker/TaskDiagram/TaskToRootStepEdgeBuilder.html +290 -0
- data/docs/Tasker/TaskDiagram.html +548 -0
- data/docs/Tasker/TaskDiagramsController.html +240 -0
- data/docs/Tasker/TaskExecutionContext.html +469 -0
- data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner/ClassBasedEventRegistrar.html +238 -0
- data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner/YamlEventRegistrar.html +254 -0
- data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner.html +988 -0
- data/docs/Tasker/TaskHandler/ClassMethods.html +357 -0
- data/docs/Tasker/TaskHandler/InstanceMethods.html +1396 -0
- data/docs/Tasker/TaskHandler/StepGroup.html +1748 -0
- data/docs/Tasker/TaskHandler.html +271 -0
- data/docs/Tasker/TaskNamespace.html +312 -0
- data/docs/Tasker/TaskRunnerJob.html +406 -0
- data/docs/Tasker/TaskSerializer.html +474 -0
- data/docs/Tasker/TaskTransition.html +1517 -0
- data/docs/Tasker/TaskWorkflowSummary.html +988 -0
- data/docs/Tasker/TaskerRailsSchema/InvalidObjectTypeError.html +132 -0
- data/docs/Tasker/TaskerRailsSchema/TypeResolutionError.html +139 -0
- data/docs/Tasker/TaskerRailsSchema/UnknownInterfaceError.html +132 -0
- data/docs/Tasker/TaskerRailsSchema.html +384 -0
- data/docs/Tasker/TasksController.html +595 -0
- data/docs/Tasker/Telemetry/EventMapping.html +1307 -0
- data/docs/Tasker/Telemetry/EventRouter.html +2178 -0
- data/docs/Tasker/Telemetry/Events/ExportEvents.html +246 -0
- data/docs/Tasker/Telemetry/Events.html +115 -0
- data/docs/Tasker/Telemetry/ExportCoordinator/DistributedLockTimeoutError.html +135 -0
- data/docs/Tasker/Telemetry/ExportCoordinator.html +2137 -0
- data/docs/Tasker/Telemetry/IntelligentCacheManager.html +1083 -0
- data/docs/Tasker/Telemetry/LogBackend.html +1088 -0
- data/docs/Tasker/Telemetry/MetricTypes/Counter.html +1054 -0
- data/docs/Tasker/Telemetry/MetricTypes/Gauge.html +1270 -0
- data/docs/Tasker/Telemetry/MetricTypes/Histogram.html +1492 -0
- data/docs/Tasker/Telemetry/MetricTypes.html +153 -0
- data/docs/Tasker/Telemetry/MetricsBackend.html +2510 -0
- data/docs/Tasker/Telemetry/MetricsExportService.html +578 -0
- data/docs/Tasker/Telemetry/PluginRegistry.html +1774 -0
- data/docs/Tasker/Telemetry/Plugins/BaseExporter.html +1835 -0
- data/docs/Tasker/Telemetry/Plugins/CsvExporter.html +768 -0
- data/docs/Tasker/Telemetry/Plugins/JsonExporter.html +747 -0
- data/docs/Tasker/Telemetry/Plugins.html +117 -0
- data/docs/Tasker/Telemetry/PrometheusExporter.html +481 -0
- data/docs/Tasker/Telemetry/TraceBackend.html +891 -0
- data/docs/Tasker/Telemetry.html +130 -0
- data/docs/Tasker/Types/AuthConfig.html +886 -0
- data/docs/Tasker/Types/BackoffConfig.html +1063 -0
- data/docs/Tasker/Types/BaseConfig.html +227 -0
- data/docs/Tasker/Types/CacheConfig.html +1731 -0
- data/docs/Tasker/Types/DatabaseConfig.html +388 -0
- data/docs/Tasker/Types/DependencyGraph.html +526 -0
- data/docs/Tasker/Types/DependencyGraphConfig.html +753 -0
- data/docs/Tasker/Types/EngineConfig.html +1181 -0
- data/docs/Tasker/Types/ExecutionConfig.html +1963 -0
- data/docs/Tasker/Types/GraphEdge.html +517 -0
- data/docs/Tasker/Types/GraphMetadata.html +781 -0
- data/docs/Tasker/Types/GraphNode.html +694 -0
- data/docs/Tasker/Types/HealthConfig.html +784 -0
- data/docs/Tasker/Types/StepSequence.html +353 -0
- data/docs/Tasker/Types/StepTemplate.html +1193 -0
- data/docs/Tasker/Types/TaskRequest.html +1179 -0
- data/docs/Tasker/Types/TelemetryConfig.html +2746 -0
- data/docs/Tasker/Types.html +154 -0
- data/docs/Tasker/WorkflowStep/StepFinder.html +282 -0
- data/docs/Tasker/WorkflowStep.html +2724 -0
- data/docs/Tasker/WorkflowStepEdge.html +304 -0
- data/docs/Tasker/WorkflowStepSerializer.html +305 -0
- data/docs/Tasker/WorkflowStepTransition/TransitionDescriptionFormatter.html +282 -0
- data/docs/Tasker/WorkflowStepTransition.html +2201 -0
- data/docs/Tasker/WorkflowStepsController.html +462 -0
- data/docs/Tasker.html +452 -0
- data/docs/VISION.md +584 -0
- data/docs/WHY.md +21 -0
- data/docs/_index.html +2375 -0
- data/docs/class_list.html +54 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +503 -0
- data/docs/events/migration_plan_outcomes.md +80 -0
- data/docs/file.README.html +541 -0
- data/docs/file_list.html +59 -0
- data/docs/frames.html +22 -0
- data/docs/index.html +541 -0
- data/docs/js/app.js +344 -0
- data/docs/js/full_list.js +242 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +9182 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/generators/tasker/authenticator_generator.rb +301 -0
- data/lib/generators/tasker/authorization_coordinator_generator.rb +139 -0
- data/lib/generators/tasker/events_generator.rb +91 -0
- data/lib/generators/tasker/subscriber_generator.rb +107 -0
- data/lib/generators/tasker/task_handler_generator.rb +138 -0
- data/lib/generators/tasker/templates/api_token_authenticator.rb.erb +113 -0
- data/lib/generators/tasker/templates/api_token_authenticator_spec.rb.erb +144 -0
- data/lib/generators/tasker/templates/authorization_coordinator.rb.erb +95 -0
- data/lib/generators/tasker/templates/authorization_coordinator_spec.rb.erb +142 -0
- data/lib/generators/tasker/templates/custom_authenticator.rb.erb +108 -0
- data/lib/generators/tasker/templates/custom_authenticator_spec.rb.erb +162 -0
- data/lib/generators/tasker/templates/custom_events.yml.erb +62 -0
- data/lib/generators/tasker/templates/custom_subscriber.rb.erb +72 -0
- data/lib/generators/tasker/templates/devise_authenticator.rb.erb +101 -0
- data/lib/generators/tasker/templates/devise_authenticator_spec.rb.erb +126 -0
- data/lib/generators/tasker/templates/initialize.rb.erb +202 -0
- data/lib/generators/tasker/templates/jwt_authenticator.rb.erb +144 -0
- data/lib/generators/tasker/templates/jwt_authenticator_spec.rb.erb +298 -0
- data/lib/generators/tasker/templates/metrics_subscriber.rb.erb +258 -0
- data/lib/generators/tasker/templates/metrics_subscriber_spec.rb.erb +308 -0
- data/lib/generators/tasker/templates/omniauth_authenticator.rb.erb +135 -0
- data/lib/generators/tasker/templates/omniauth_authenticator_spec.rb.erb +196 -0
- data/lib/generators/tasker/templates/opentelemetry_initializer.rb +52 -0
- data/lib/generators/tasker/templates/subscriber.rb.erb +64 -0
- data/lib/generators/tasker/templates/subscriber_spec.rb.erb +80 -0
- data/lib/generators/tasker/templates/task_config.yaml.erb +117 -0
- data/lib/generators/tasker/templates/task_handler.rb.erb +59 -0
- data/lib/generators/tasker/templates/task_handler_spec.rb.erb +159 -0
- data/lib/tasker/analysis/runtime_graph_analyzer.rb +1168 -0
- data/lib/tasker/analysis/template_graph_analyzer.rb +328 -0
- data/lib/tasker/authentication/coordinator.rb +78 -0
- data/lib/tasker/authentication/errors.rb +9 -0
- data/lib/tasker/authentication/interface.rb +36 -0
- data/lib/tasker/authentication/none_authenticator.rb +26 -0
- data/lib/tasker/authorization/base_coordinator.rb +112 -0
- data/lib/tasker/authorization/errors.rb +26 -0
- data/lib/tasker/authorization/resource_constants.rb +74 -0
- data/lib/tasker/authorization/resource_registry.rb +143 -0
- data/lib/tasker/authorization.rb +75 -0
- data/lib/tasker/cache_capabilities.rb +131 -0
- data/lib/tasker/cache_strategy.rb +469 -0
- data/lib/tasker/concerns/authenticatable.rb +41 -0
- data/lib/tasker/concerns/authorizable.rb +204 -0
- data/lib/tasker/concerns/controller_authorizable.rb +124 -0
- data/lib/tasker/concerns/event_publisher.rb +716 -0
- data/lib/tasker/concerns/idempotent_state_transitions.rb +128 -0
- data/lib/tasker/concerns/state_machine_base.rb +218 -0
- data/lib/tasker/concerns/structured_logging.rb +387 -0
- data/lib/tasker/configuration.rb +325 -0
- data/lib/tasker/constants/event_definitions.rb +147 -0
- data/lib/tasker/constants/registry_events.rb +54 -0
- data/lib/tasker/constants.rb +417 -0
- data/lib/tasker/engine.rb +90 -0
- data/lib/tasker/errors.rb +90 -0
- data/lib/tasker/events/catalog.rb +432 -0
- data/lib/tasker/events/custom_registry.rb +175 -0
- data/lib/tasker/events/definition_loader.rb +199 -0
- data/lib/tasker/events/event_payload_builder.rb +461 -0
- data/lib/tasker/events/publisher.rb +149 -0
- data/lib/tasker/events/subscribers/base_subscriber.rb +601 -0
- data/lib/tasker/events/subscribers/metrics_subscriber.rb +120 -0
- data/lib/tasker/events/subscribers/telemetry_subscriber.rb +462 -0
- data/lib/tasker/events/subscription_loader.rb +161 -0
- data/lib/tasker/events.rb +37 -0
- data/lib/tasker/functions/function_based_analytics_metrics.rb +103 -0
- data/lib/tasker/functions/function_based_dependency_levels.rb +54 -0
- data/lib/tasker/functions/function_based_slowest_steps.rb +84 -0
- data/lib/tasker/functions/function_based_slowest_tasks.rb +84 -0
- data/lib/tasker/functions/function_based_step_readiness_status.rb +183 -0
- data/lib/tasker/functions/function_based_system_health_counts.rb +94 -0
- data/lib/tasker/functions/function_based_task_execution_context.rb +148 -0
- data/lib/tasker/functions/function_wrapper.rb +42 -0
- data/lib/tasker/functions.rb +12 -0
- data/lib/tasker/handler_factory.rb +322 -0
- data/lib/tasker/health/readiness_checker.rb +186 -0
- data/lib/tasker/health/status_checker.rb +203 -0
- data/lib/tasker/identity_strategy.rb +38 -0
- data/lib/tasker/logging/correlation_id_generator.rb +120 -0
- data/lib/tasker/orchestration/backoff_calculator.rb +184 -0
- data/lib/tasker/orchestration/connection_builder.rb +122 -0
- data/lib/tasker/orchestration/connection_pool_intelligence.rb +177 -0
- data/lib/tasker/orchestration/coordinator.rb +119 -0
- data/lib/tasker/orchestration/future_state_analyzer.rb +137 -0
- data/lib/tasker/orchestration/plugin_integration.rb +124 -0
- data/lib/tasker/orchestration/response_processor.rb +168 -0
- data/lib/tasker/orchestration/retry_header_parser.rb +78 -0
- data/lib/tasker/orchestration/step_executor.rb +941 -0
- data/lib/tasker/orchestration/step_sequence_factory.rb +67 -0
- data/lib/tasker/orchestration/task_finalizer.rb +564 -0
- data/lib/tasker/orchestration/task_initializer.rb +140 -0
- data/lib/tasker/orchestration/task_reenqueuer.rb +71 -0
- data/lib/tasker/orchestration/viable_step_discovery.rb +65 -0
- data/lib/tasker/orchestration/workflow_coordinator.rb +294 -0
- data/lib/tasker/orchestration.rb +45 -0
- data/lib/tasker/railtie.rb +9 -0
- data/lib/tasker/registry/base_registry.rb +177 -0
- data/lib/tasker/registry/event_publisher.rb +91 -0
- data/lib/tasker/registry/interface_validator.rb +140 -0
- data/lib/tasker/registry/statistics_collector.rb +381 -0
- data/lib/tasker/registry/subscriber_registry.rb +285 -0
- data/lib/tasker/registry.rb +22 -0
- data/lib/tasker/state_machine/step_state_machine.rb +508 -0
- data/lib/tasker/state_machine/task_state_machine.rb +192 -0
- data/lib/tasker/state_machine.rb +83 -0
- data/lib/tasker/step_handler/api.rb +410 -0
- data/lib/tasker/step_handler/base.rb +206 -0
- data/lib/tasker/task_builder.rb +432 -0
- data/lib/tasker/task_handler/class_methods.rb +324 -0
- data/lib/tasker/task_handler/instance_methods.rb +293 -0
- data/lib/tasker/task_handler/step_group.rb +182 -0
- data/lib/tasker/task_handler.rb +43 -0
- data/lib/tasker/telemetry/event_mapping.rb +126 -0
- data/lib/tasker/telemetry/event_router.rb +318 -0
- data/lib/tasker/telemetry/events/export_events.rb +38 -0
- data/lib/tasker/telemetry/export_coordinator.rb +497 -0
- data/lib/tasker/telemetry/intelligent_cache_manager.rb +508 -0
- data/lib/tasker/telemetry/log_backend.rb +224 -0
- data/lib/tasker/telemetry/metric_types.rb +368 -0
- data/lib/tasker/telemetry/metrics_backend.rb +1227 -0
- data/lib/tasker/telemetry/metrics_export_service.rb +392 -0
- data/lib/tasker/telemetry/plugin_registry.rb +333 -0
- data/lib/tasker/telemetry/plugins/base_exporter.rb +246 -0
- data/lib/tasker/telemetry/plugins/csv_exporter.rb +198 -0
- data/lib/tasker/telemetry/plugins/json_exporter.rb +141 -0
- data/lib/tasker/telemetry/prometheus_exporter.rb +249 -0
- data/lib/tasker/telemetry/trace_backend.rb +186 -0
- data/lib/tasker/telemetry.rb +59 -0
- data/lib/tasker/types/auth_config.rb +81 -0
- data/lib/tasker/types/backoff_config.rb +142 -0
- data/lib/tasker/types/cache_config.rb +257 -0
- data/lib/tasker/types/database_config.rb +39 -0
- data/lib/tasker/types/dependency_graph.rb +225 -0
- data/lib/tasker/types/dependency_graph_config.rb +149 -0
- data/lib/tasker/types/engine_config.rb +131 -0
- data/lib/tasker/types/execution_config.rb +289 -0
- data/lib/tasker/types/health_config.rb +84 -0
- data/lib/tasker/types/step_sequence.rb +24 -0
- data/lib/tasker/types/step_template.rb +63 -0
- data/lib/tasker/types/task_request.rb +60 -0
- data/lib/tasker/types/telemetry_config.rb +273 -0
- data/lib/tasker/types.rb +64 -0
- data/lib/tasker/version.rb +7 -0
- data/lib/tasker.rb +82 -0
- data/lib/tasks/tasker_tasks.rake +302 -0
- metadata +958 -0
@@ -0,0 +1,4023 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: Tasker::Concerns::EventPublisher
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.37
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Tasker::Concerns::EventPublisher";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (E)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span> » <span class='title'><span class='object_link'><a href="../Concerns.html" title="Tasker::Concerns (module)">Concerns</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">EventPublisher</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: Tasker::Concerns::EventPublisher
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
<dl>
|
73
|
+
<dt>Extended by:</dt>
|
74
|
+
<dd>ActiveSupport::Concern</dd>
|
75
|
+
</dl>
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
<dl>
|
83
|
+
<dt>Included in:</dt>
|
84
|
+
<dd><span class='object_link'><a href="StateMachineBase.html" title="Tasker::Concerns::StateMachineBase (module)">StateMachineBase</a></span>, <span class='object_link'><a href="../Orchestration/BackoffCalculator.html" title="Tasker::Orchestration::BackoffCalculator (class)">Orchestration::BackoffCalculator</a></span>, <span class='object_link'><a href="../Orchestration/ResponseProcessor.html" title="Tasker::Orchestration::ResponseProcessor (class)">Orchestration::ResponseProcessor</a></span>, <span class='object_link'><a href="../Orchestration/StepExecutor.html" title="Tasker::Orchestration::StepExecutor (class)">Orchestration::StepExecutor</a></span>, <span class='object_link'><a href="../Orchestration/TaskFinalizer.html" title="Tasker::Orchestration::TaskFinalizer (class)">Orchestration::TaskFinalizer</a></span>, <span class='object_link'><a href="../Orchestration/TaskInitializer.html" title="Tasker::Orchestration::TaskInitializer (class)">Orchestration::TaskInitializer</a></span>, <span class='object_link'><a href="../Orchestration/TaskReenqueuer.html" title="Tasker::Orchestration::TaskReenqueuer (class)">Orchestration::TaskReenqueuer</a></span>, <span class='object_link'><a href="../Orchestration/ViableStepDiscovery.html" title="Tasker::Orchestration::ViableStepDiscovery (class)">Orchestration::ViableStepDiscovery</a></span>, <span class='object_link'><a href="../Orchestration/WorkflowCoordinator.html" title="Tasker::Orchestration::WorkflowCoordinator (class)">Orchestration::WorkflowCoordinator</a></span>, <span class='object_link'><a href="../StateMachine/StepStateMachine.html" title="Tasker::StateMachine::StepStateMachine (class)">StateMachine::StepStateMachine</a></span>, <span class='object_link'><a href="../StateMachine/TaskStateMachine.html" title="Tasker::StateMachine::TaskStateMachine (class)">StateMachine::TaskStateMachine</a></span>, <span class='object_link'><a href="../StepHandler/Api.html" title="Tasker::StepHandler::Api (class)">StepHandler::Api</a></span>, <span class='object_link'><a href="../StepHandler/Base.html" title="Tasker::StepHandler::Base (class)">StepHandler::Base</a></span>, <span class='object_link'><a href="../TaskHandler/InstanceMethods.html" title="Tasker::TaskHandler::InstanceMethods (module)">TaskHandler::InstanceMethods</a></span>, <span class='object_link'><a href="../TaskRunnerJob.html" title="Tasker::TaskRunnerJob (class)">TaskRunnerJob</a></span></dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<dl>
|
90
|
+
<dt>Defined in:</dt>
|
91
|
+
<dd>lib/tasker/concerns/event_publisher.rb</dd>
|
92
|
+
</dl>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
<h2>Overview</h2><div class="docstring">
|
97
|
+
<div class="discussion">
|
98
|
+
|
99
|
+
<p>EventPublisher provides a clean interface for publishing events</p>
|
100
|
+
|
101
|
+
<p>This concern provides domain-specific event publishing methods that automatically build standardized payloads and resolve event constants. The API is designed for maximum clarity and minimum cognitive overhead.</p>
|
102
|
+
|
103
|
+
<p>Enhanced with structured logging integration for production observability.</p>
|
104
|
+
|
105
|
+
<p>Usage: include Tasker::Concerns::EventPublisher</p>
|
106
|
+
|
107
|
+
<p># Step events - method name determines event type automatically publish_step_completed(step, operation_count: 42) publish_step_failed(step, error: exception) publish_step_started(step)</p>
|
108
|
+
|
109
|
+
<p># Task events - clean and obvious publish_task_started(task) publish_task_completed(task, total_duration: 120.5) publish_task_failed(task, error_message: “Payment failed”)</p>
|
110
|
+
|
111
|
+
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
<div class="tags">
|
115
|
+
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<h2>
|
126
|
+
Instance Method Summary
|
127
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
128
|
+
</h2>
|
129
|
+
|
130
|
+
<ul class="summary">
|
131
|
+
|
132
|
+
<li class="public ">
|
133
|
+
<span class="summary_signature">
|
134
|
+
|
135
|
+
<a href="#infer_step_event_type_from_state-instance_method" title="#infer_step_event_type_from_state (instance method)">#<strong>infer_step_event_type_from_state</strong>(step) ⇒ Symbol </a>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
</span>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
<span class="summary_desc"><div class='inline'>
|
150
|
+
<p>Infer step event type from step state and context.</p>
|
151
|
+
</div></span>
|
152
|
+
|
153
|
+
</li>
|
154
|
+
|
155
|
+
|
156
|
+
<li class="public ">
|
157
|
+
<span class="summary_signature">
|
158
|
+
|
159
|
+
<a href="#publish_custom_event-instance_method" title="#publish_custom_event (instance method)">#<strong>publish_custom_event</strong>(event_name, payload = {}) ⇒ void </a>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
</span>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<span class="summary_desc"><div class='inline'>
|
174
|
+
<p>Publish a custom event with standard metadata Assumes the event is already registered.</p>
|
175
|
+
</div></span>
|
176
|
+
|
177
|
+
</li>
|
178
|
+
|
179
|
+
|
180
|
+
<li class="public ">
|
181
|
+
<span class="summary_signature">
|
182
|
+
|
183
|
+
<a href="#publish_no_viable_steps-instance_method" title="#publish_no_viable_steps (instance method)">#<strong>publish_no_viable_steps</strong>(task_id, reason: 'No steps ready for execution', **context) ⇒ void </a>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
</span>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<span class="summary_desc"><div class='inline'>
|
198
|
+
<p>Publish no viable steps event Automatically resolves to WorkflowEvents::NO_VIABLE_STEPS.</p>
|
199
|
+
</div></span>
|
200
|
+
|
201
|
+
</li>
|
202
|
+
|
203
|
+
|
204
|
+
<li class="public ">
|
205
|
+
<span class="summary_signature">
|
206
|
+
|
207
|
+
<a href="#publish_step_backoff-instance_method" title="#publish_step_backoff (instance method)">#<strong>publish_step_backoff</strong>(step, backoff_seconds:, backoff_type: 'exponential', **context) ⇒ void </a>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</span>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
<span class="summary_desc"><div class='inline'>
|
222
|
+
<p>Publish step backoff event (for retry/rate limiting scenarios) Automatically resolves to ObservabilityEvents::Step::BACKOFF.</p>
|
223
|
+
</div></span>
|
224
|
+
|
225
|
+
</li>
|
226
|
+
|
227
|
+
|
228
|
+
<li class="public ">
|
229
|
+
<span class="summary_signature">
|
230
|
+
|
231
|
+
<a href="#publish_step_before_handle-instance_method" title="#publish_step_before_handle (instance method)">#<strong>publish_step_before_handle</strong>(step, **context) ⇒ void </a>
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
</span>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<span class="summary_desc"><div class='inline'>
|
246
|
+
<p>Publish step before handle event Automatically resolves to StepEvents::BEFORE_HANDLE with :before_handle event type.</p>
|
247
|
+
</div></span>
|
248
|
+
|
249
|
+
</li>
|
250
|
+
|
251
|
+
|
252
|
+
<li class="public ">
|
253
|
+
<span class="summary_signature">
|
254
|
+
|
255
|
+
<a href="#publish_step_cancelled-instance_method" title="#publish_step_cancelled (instance method)">#<strong>publish_step_cancelled</strong>(step, cancellation_reason: 'Step cancelled', **context) ⇒ void </a>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
</span>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
<span class="summary_desc"><div class='inline'>
|
270
|
+
<p>Publish step cancelled event Automatically resolves to StepEvents::CANCELLED with :cancelled event type.</p>
|
271
|
+
</div></span>
|
272
|
+
|
273
|
+
</li>
|
274
|
+
|
275
|
+
|
276
|
+
<li class="public ">
|
277
|
+
<span class="summary_signature">
|
278
|
+
|
279
|
+
<a href="#publish_step_completed-instance_method" title="#publish_step_completed (instance method)">#<strong>publish_step_completed</strong>(step, **context) ⇒ void </a>
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
</span>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
<span class="summary_desc"><div class='inline'>
|
294
|
+
<p>Publish step completed event Automatically resolves to StepEvents::COMPLETED with :completed event type.</p>
|
295
|
+
</div></span>
|
296
|
+
|
297
|
+
</li>
|
298
|
+
|
299
|
+
|
300
|
+
<li class="public ">
|
301
|
+
<span class="summary_signature">
|
302
|
+
|
303
|
+
<a href="#publish_step_event_for_context-instance_method" title="#publish_step_event_for_context (instance method)">#<strong>publish_step_event_for_context</strong>(step, context_hint: nil, **context) ⇒ void </a>
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
</span>
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
<span class="summary_desc"><div class='inline'>
|
318
|
+
<p>Automatically determine and publish the appropriate step event based on step state This method uses the step’s current state to infer the most appropriate event type.</p>
|
319
|
+
</div></span>
|
320
|
+
|
321
|
+
</li>
|
322
|
+
|
323
|
+
|
324
|
+
<li class="public ">
|
325
|
+
<span class="summary_signature">
|
326
|
+
|
327
|
+
<a href="#publish_step_failed-instance_method" title="#publish_step_failed (instance method)">#<strong>publish_step_failed</strong>(step, error: nil, **context) ⇒ void </a>
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
</span>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
<span class="summary_desc"><div class='inline'>
|
342
|
+
<p>Publish step failed event Automatically resolves to StepEvents::FAILED with :failed event type Automatically extracts error information if :error is provided.</p>
|
343
|
+
</div></span>
|
344
|
+
|
345
|
+
</li>
|
346
|
+
|
347
|
+
|
348
|
+
<li class="public ">
|
349
|
+
<span class="summary_signature">
|
350
|
+
|
351
|
+
<a href="#publish_step_retry_requested-instance_method" title="#publish_step_retry_requested (instance method)">#<strong>publish_step_retry_requested</strong>(step, retry_reason: 'Step execution failed', **context) ⇒ void </a>
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
</span>
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
<span class="summary_desc"><div class='inline'>
|
366
|
+
<p>Publish step retry requested event Automatically resolves to StepEvents::RETRY_REQUESTED with :retry event type.</p>
|
367
|
+
</div></span>
|
368
|
+
|
369
|
+
</li>
|
370
|
+
|
371
|
+
|
372
|
+
<li class="public ">
|
373
|
+
<span class="summary_signature">
|
374
|
+
|
375
|
+
<a href="#publish_step_started-instance_method" title="#publish_step_started (instance method)">#<strong>publish_step_started</strong>(step, **context) ⇒ void </a>
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
</span>
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
<span class="summary_desc"><div class='inline'>
|
390
|
+
<p>Publish step started event Automatically resolves to StepEvents::EXECUTION_REQUESTED with :started event type.</p>
|
391
|
+
</div></span>
|
392
|
+
|
393
|
+
</li>
|
394
|
+
|
395
|
+
|
396
|
+
<li class="public ">
|
397
|
+
<span class="summary_signature">
|
398
|
+
|
399
|
+
<a href="#publish_steps_execution_completed-instance_method" title="#publish_steps_execution_completed (instance method)">#<strong>publish_steps_execution_completed</strong>(task, processed_count:, successful_count:, **context) ⇒ void </a>
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
</span>
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
<span class="summary_desc"><div class='inline'>
|
414
|
+
<p>Publish steps execution completed event (batch processing) Automatically resolves to WorkflowEvents::STEPS_EXECUTION_COMPLETED.</p>
|
415
|
+
</div></span>
|
416
|
+
|
417
|
+
</li>
|
418
|
+
|
419
|
+
|
420
|
+
<li class="public ">
|
421
|
+
<span class="summary_signature">
|
422
|
+
|
423
|
+
<a href="#publish_steps_execution_started-instance_method" title="#publish_steps_execution_started (instance method)">#<strong>publish_steps_execution_started</strong>(task, step_count:, processing_mode: 'concurrent', **context) ⇒ void </a>
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
</span>
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
<span class="summary_desc"><div class='inline'>
|
438
|
+
<p>Publish steps execution started event (batch processing) Automatically resolves to WorkflowEvents::STEPS_EXECUTION_STARTED.</p>
|
439
|
+
</div></span>
|
440
|
+
|
441
|
+
</li>
|
442
|
+
|
443
|
+
|
444
|
+
<li class="public ">
|
445
|
+
<span class="summary_signature">
|
446
|
+
|
447
|
+
<a href="#publish_task_completed-instance_method" title="#publish_task_completed (instance method)">#<strong>publish_task_completed</strong>(task, **context) ⇒ void </a>
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
</span>
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
<span class="summary_desc"><div class='inline'>
|
462
|
+
<p>Publish task completed event Automatically resolves to TaskEvents::COMPLETED with :completed event type.</p>
|
463
|
+
</div></span>
|
464
|
+
|
465
|
+
</li>
|
466
|
+
|
467
|
+
|
468
|
+
<li class="public ">
|
469
|
+
<span class="summary_signature">
|
470
|
+
|
471
|
+
<a href="#publish_task_enqueue-instance_method" title="#publish_task_enqueue (instance method)">#<strong>publish_task_enqueue</strong>(task, **context) ⇒ void </a>
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
</span>
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
<span class="summary_desc"><div class='inline'>
|
486
|
+
<p>Publish task enqueue event (for job scheduling observability) Automatically resolves to ObservabilityEvents::Task::ENQUEUE.</p>
|
487
|
+
</div></span>
|
488
|
+
|
489
|
+
</li>
|
490
|
+
|
491
|
+
|
492
|
+
<li class="public ">
|
493
|
+
<span class="summary_signature">
|
494
|
+
|
495
|
+
<a href="#publish_task_failed-instance_method" title="#publish_task_failed (instance method)">#<strong>publish_task_failed</strong>(task, error_message: 'Task execution failed', error_steps: [], **context) ⇒ void </a>
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
</span>
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
<span class="summary_desc"><div class='inline'>
|
510
|
+
<p>Publish task failed event Automatically resolves to TaskEvents::FAILED with :failed event type.</p>
|
511
|
+
</div></span>
|
512
|
+
|
513
|
+
</li>
|
514
|
+
|
515
|
+
|
516
|
+
<li class="public ">
|
517
|
+
<span class="summary_signature">
|
518
|
+
|
519
|
+
<a href="#publish_task_finalization_completed-instance_method" title="#publish_task_finalization_completed (instance method)">#<strong>publish_task_finalization_completed</strong>(task, processed_steps_count: 0, **context) ⇒ void </a>
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
</span>
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
<span class="summary_desc"><div class='inline'>
|
534
|
+
<p>Publish task finalization completed event.</p>
|
535
|
+
</div></span>
|
536
|
+
|
537
|
+
</li>
|
538
|
+
|
539
|
+
|
540
|
+
<li class="public ">
|
541
|
+
<span class="summary_signature">
|
542
|
+
|
543
|
+
<a href="#publish_task_finalization_started-instance_method" title="#publish_task_finalization_started (instance method)">#<strong>publish_task_finalization_started</strong>(task, processed_steps_count: 0, **context) ⇒ void </a>
|
544
|
+
|
545
|
+
|
546
|
+
|
547
|
+
</span>
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
<span class="summary_desc"><div class='inline'>
|
558
|
+
<p>Publish task finalization started event.</p>
|
559
|
+
</div></span>
|
560
|
+
|
561
|
+
</li>
|
562
|
+
|
563
|
+
|
564
|
+
<li class="public ">
|
565
|
+
<span class="summary_signature">
|
566
|
+
|
567
|
+
<a href="#publish_task_pending_transition-instance_method" title="#publish_task_pending_transition (instance method)">#<strong>publish_task_pending_transition</strong>(task, reason: 'Task set to pending', **context) ⇒ void </a>
|
568
|
+
|
569
|
+
|
570
|
+
|
571
|
+
</span>
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
<span class="summary_desc"><div class='inline'>
|
582
|
+
<p>Publish task pending transition event (for synchronous processing) Automatically resolves to TaskEvents::INITIALIZE_REQUESTED with pending context.</p>
|
583
|
+
</div></span>
|
584
|
+
|
585
|
+
</li>
|
586
|
+
|
587
|
+
|
588
|
+
<li class="public ">
|
589
|
+
<span class="summary_signature">
|
590
|
+
|
591
|
+
<a href="#publish_task_reenqueue_delayed-instance_method" title="#publish_task_reenqueue_delayed (instance method)">#<strong>publish_task_reenqueue_delayed</strong>(task, delay_seconds:, reason: 'Task reenqueue delayed', **context) ⇒ void </a>
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
</span>
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
<span class="summary_desc"><div class='inline'>
|
606
|
+
<p>Publish task reenqueue delayed event Automatically resolves to WorkflowEvents::TASK_REENQUEUE_DELAYED.</p>
|
607
|
+
</div></span>
|
608
|
+
|
609
|
+
</li>
|
610
|
+
|
611
|
+
|
612
|
+
<li class="public ">
|
613
|
+
<span class="summary_signature">
|
614
|
+
|
615
|
+
<a href="#publish_task_reenqueue_failed-instance_method" title="#publish_task_reenqueue_failed (instance method)">#<strong>publish_task_reenqueue_failed</strong>(task, reason: 'Task reenqueue failed', error: 'Unknown error', **context) ⇒ void </a>
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
</span>
|
620
|
+
|
621
|
+
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
<span class="summary_desc"><div class='inline'>
|
630
|
+
<p>Publish task reenqueue failed event Automatically resolves to WorkflowEvents::TASK_REENQUEUE_FAILED.</p>
|
631
|
+
</div></span>
|
632
|
+
|
633
|
+
</li>
|
634
|
+
|
635
|
+
|
636
|
+
<li class="public ">
|
637
|
+
<span class="summary_signature">
|
638
|
+
|
639
|
+
<a href="#publish_task_reenqueue_requested-instance_method" title="#publish_task_reenqueue_requested (instance method)">#<strong>publish_task_reenqueue_requested</strong>(task, reason: 'Task reenqueue requested', **context) ⇒ void </a>
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
</span>
|
644
|
+
|
645
|
+
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
<span class="summary_desc"><div class='inline'>
|
654
|
+
<p>Publish task reenqueue requested event Automatically resolves to WorkflowEvents::TASK_REENQUEUE_REQUESTED.</p>
|
655
|
+
</div></span>
|
656
|
+
|
657
|
+
</li>
|
658
|
+
|
659
|
+
|
660
|
+
<li class="public ">
|
661
|
+
<span class="summary_signature">
|
662
|
+
|
663
|
+
<a href="#publish_task_reenqueue_started-instance_method" title="#publish_task_reenqueue_started (instance method)">#<strong>publish_task_reenqueue_started</strong>(task, reason: 'Task reenqueue started', **context) ⇒ void </a>
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
</span>
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
|
677
|
+
<span class="summary_desc"><div class='inline'>
|
678
|
+
<p>Publish task reenqueue started event Automatically resolves to WorkflowEvents::TASK_REENQUEUE_STARTED.</p>
|
679
|
+
</div></span>
|
680
|
+
|
681
|
+
</li>
|
682
|
+
|
683
|
+
|
684
|
+
<li class="public ">
|
685
|
+
<span class="summary_signature">
|
686
|
+
|
687
|
+
<a href="#publish_task_retry_requested-instance_method" title="#publish_task_retry_requested (instance method)">#<strong>publish_task_retry_requested</strong>(task, retry_reason: 'Task retry requested', **context) ⇒ void </a>
|
688
|
+
|
689
|
+
|
690
|
+
|
691
|
+
</span>
|
692
|
+
|
693
|
+
|
694
|
+
|
695
|
+
|
696
|
+
|
697
|
+
|
698
|
+
|
699
|
+
|
700
|
+
|
701
|
+
<span class="summary_desc"><div class='inline'>
|
702
|
+
<p>Publish task retry requested event Automatically resolves to TaskEvents::RETRY_REQUESTED with :retry event type.</p>
|
703
|
+
</div></span>
|
704
|
+
|
705
|
+
</li>
|
706
|
+
|
707
|
+
|
708
|
+
<li class="public ">
|
709
|
+
<span class="summary_signature">
|
710
|
+
|
711
|
+
<a href="#publish_task_started-instance_method" title="#publish_task_started (instance method)">#<strong>publish_task_started</strong>(task, **context) ⇒ void </a>
|
712
|
+
|
713
|
+
|
714
|
+
|
715
|
+
</span>
|
716
|
+
|
717
|
+
|
718
|
+
|
719
|
+
|
720
|
+
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
<span class="summary_desc"><div class='inline'>
|
726
|
+
<p>Publish task started event Automatically resolves to TaskEvents::START_REQUESTED with :started event type.</p>
|
727
|
+
</div></span>
|
728
|
+
|
729
|
+
</li>
|
730
|
+
|
731
|
+
|
732
|
+
<li class="public ">
|
733
|
+
<span class="summary_signature">
|
734
|
+
|
735
|
+
<a href="#publish_viable_steps_discovered-instance_method" title="#publish_viable_steps_discovered (instance method)">#<strong>publish_viable_steps_discovered</strong>(task_id, step_ids, processing_mode: 'concurrent', **context) ⇒ void </a>
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
</span>
|
740
|
+
|
741
|
+
|
742
|
+
|
743
|
+
|
744
|
+
|
745
|
+
|
746
|
+
|
747
|
+
|
748
|
+
|
749
|
+
<span class="summary_desc"><div class='inline'>
|
750
|
+
<p>Publish viable steps discovered event Automatically resolves to WorkflowEvents::VIABLE_STEPS_DISCOVERED.</p>
|
751
|
+
</div></span>
|
752
|
+
|
753
|
+
</li>
|
754
|
+
|
755
|
+
|
756
|
+
<li class="public ">
|
757
|
+
<span class="summary_signature">
|
758
|
+
|
759
|
+
<a href="#publish_workflow_state_unclear-instance_method" title="#publish_workflow_state_unclear (instance method)">#<strong>publish_workflow_state_unclear</strong>(task, reason: 'Task in unclear state', **context) ⇒ void </a>
|
760
|
+
|
761
|
+
|
762
|
+
|
763
|
+
</span>
|
764
|
+
|
765
|
+
|
766
|
+
|
767
|
+
|
768
|
+
|
769
|
+
|
770
|
+
|
771
|
+
|
772
|
+
|
773
|
+
<span class="summary_desc"><div class='inline'>
|
774
|
+
<p>Publish workflow unclear state event (for monitoring/alerting) Automatically resolves to WorkflowEvents::TASK_STATE_UNCLEAR.</p>
|
775
|
+
</div></span>
|
776
|
+
|
777
|
+
</li>
|
778
|
+
|
779
|
+
|
780
|
+
<li class="public ">
|
781
|
+
<span class="summary_signature">
|
782
|
+
|
783
|
+
<a href="#publish_workflow_step_completed-instance_method" title="#publish_workflow_step_completed (instance method)">#<strong>publish_workflow_step_completed</strong>(task_id, step_id, **context) ⇒ void </a>
|
784
|
+
|
785
|
+
|
786
|
+
|
787
|
+
</span>
|
788
|
+
|
789
|
+
|
790
|
+
|
791
|
+
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
|
797
|
+
<span class="summary_desc"><div class='inline'>
|
798
|
+
<p>Publish workflow step completed event (orchestration layer) Automatically resolves to WorkflowEvents::STEP_COMPLETED.</p>
|
799
|
+
</div></span>
|
800
|
+
|
801
|
+
</li>
|
802
|
+
|
803
|
+
|
804
|
+
<li class="public ">
|
805
|
+
<span class="summary_signature">
|
806
|
+
|
807
|
+
<a href="#publish_workflow_task_started-instance_method" title="#publish_workflow_task_started (instance method)">#<strong>publish_workflow_task_started</strong>(task_id, **context) ⇒ void </a>
|
808
|
+
|
809
|
+
|
810
|
+
|
811
|
+
</span>
|
812
|
+
|
813
|
+
|
814
|
+
|
815
|
+
|
816
|
+
|
817
|
+
|
818
|
+
|
819
|
+
|
820
|
+
|
821
|
+
<span class="summary_desc"><div class='inline'>
|
822
|
+
<p>Publish workflow task started event (orchestration layer) Automatically resolves to WorkflowEvents::TASK_STARTED.</p>
|
823
|
+
</div></span>
|
824
|
+
|
825
|
+
</li>
|
826
|
+
|
827
|
+
|
828
|
+
</ul>
|
829
|
+
|
830
|
+
|
831
|
+
|
832
|
+
|
833
|
+
|
834
|
+
<div id="instance_method_details" class="method_details_list">
|
835
|
+
<h2>Instance Method Details</h2>
|
836
|
+
|
837
|
+
|
838
|
+
<div class="method_details first">
|
839
|
+
<h3 class="signature first" id="infer_step_event_type_from_state-instance_method">
|
840
|
+
|
841
|
+
#<strong>infer_step_event_type_from_state</strong>(step) ⇒ <tt>Symbol</tt>
|
842
|
+
|
843
|
+
|
844
|
+
|
845
|
+
|
846
|
+
|
847
|
+
</h3><div class="docstring">
|
848
|
+
<div class="discussion">
|
849
|
+
|
850
|
+
<p>Infer step event type from step state and context</p>
|
851
|
+
|
852
|
+
|
853
|
+
</div>
|
854
|
+
</div>
|
855
|
+
<div class="tags">
|
856
|
+
<p class="tag_title">Parameters:</p>
|
857
|
+
<ul class="param">
|
858
|
+
|
859
|
+
<li>
|
860
|
+
|
861
|
+
<span class='name'>step</span>
|
862
|
+
|
863
|
+
|
864
|
+
<span class='type'>(<tt><span class='object_link'><a href="../WorkflowStep.html" title="Tasker::WorkflowStep (class)">WorkflowStep</a></span></tt>)</span>
|
865
|
+
|
866
|
+
|
867
|
+
|
868
|
+
—
|
869
|
+
<div class='inline'>
|
870
|
+
<p>The step object</p>
|
871
|
+
</div>
|
872
|
+
|
873
|
+
</li>
|
874
|
+
|
875
|
+
</ul>
|
876
|
+
|
877
|
+
<p class="tag_title">Returns:</p>
|
878
|
+
<ul class="return">
|
879
|
+
|
880
|
+
<li>
|
881
|
+
|
882
|
+
|
883
|
+
<span class='type'>(<tt>Symbol</tt>)</span>
|
884
|
+
|
885
|
+
|
886
|
+
|
887
|
+
—
|
888
|
+
<div class='inline'>
|
889
|
+
<p>The inferred event type</p>
|
890
|
+
</div>
|
891
|
+
|
892
|
+
</li>
|
893
|
+
|
894
|
+
</ul>
|
895
|
+
|
896
|
+
</div><table class="source_code">
|
897
|
+
<tr>
|
898
|
+
<td>
|
899
|
+
<pre class="lines">
|
900
|
+
|
901
|
+
|
902
|
+
608
|
903
|
+
609
|
904
|
+
610
|
905
|
+
611
|
906
|
+
612
|
907
|
+
613
|
908
|
+
614
|
909
|
+
615
|
910
|
+
616
|
911
|
+
617
|
912
|
+
618
|
913
|
+
619
|
914
|
+
620
|
915
|
+
621</pre>
|
916
|
+
</td>
|
917
|
+
<td>
|
918
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 608</span>
|
919
|
+
|
920
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_infer_step_event_type_from_state'>infer_step_event_type_from_state</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='rparen'>)</span>
|
921
|
+
<span class='kw'>case</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span>
|
922
|
+
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowStepStatuses.html" title="Tasker::Constants::WorkflowStepStatuses (module)">WorkflowStepStatuses</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowStepStatuses.html#IN_PROGRESS-constant" title="Tasker::Constants::WorkflowStepStatuses::IN_PROGRESS (constant)">IN_PROGRESS</a></span></span>
|
923
|
+
<span class='symbol'>:started</span>
|
924
|
+
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowStepStatuses.html" title="Tasker::Constants::WorkflowStepStatuses (module)">WorkflowStepStatuses</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowStepStatuses.html#COMPLETE-constant" title="Tasker::Constants::WorkflowStepStatuses::COMPLETE (constant)">COMPLETE</a></span></span>
|
925
|
+
<span class='symbol'>:completed</span>
|
926
|
+
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowStepStatuses.html" title="Tasker::Constants::WorkflowStepStatuses (module)">WorkflowStepStatuses</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowStepStatuses.html#ERROR-constant" title="Tasker::Constants::WorkflowStepStatuses::ERROR (constant)">ERROR</a></span></span>
|
927
|
+
<span class='symbol'>:failed</span>
|
928
|
+
<span class='kw'>when</span> <span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowStepStatuses.html" title="Tasker::Constants::WorkflowStepStatuses (module)">WorkflowStepStatuses</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowStepStatuses.html#CANCELLED-constant" title="Tasker::Constants::WorkflowStepStatuses::CANCELLED (constant)">CANCELLED</a></span></span>
|
929
|
+
<span class='symbol'>:cancelled</span>
|
930
|
+
<span class='kw'>else</span>
|
931
|
+
<span class='symbol'>:started</span> <span class='comment'># Default fallback
|
932
|
+
</span> <span class='kw'>end</span>
|
933
|
+
<span class='kw'>end</span></pre>
|
934
|
+
</td>
|
935
|
+
</tr>
|
936
|
+
</table>
|
937
|
+
</div>
|
938
|
+
|
939
|
+
<div class="method_details ">
|
940
|
+
<h3 class="signature " id="publish_custom_event-instance_method">
|
941
|
+
|
942
|
+
#<strong>publish_custom_event</strong>(event_name, payload = {}) ⇒ <tt>void</tt>
|
943
|
+
|
944
|
+
|
945
|
+
|
946
|
+
|
947
|
+
|
948
|
+
</h3><div class="docstring">
|
949
|
+
<div class="discussion">
|
950
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
951
|
+
<p>Publish a custom event with standard metadata Assumes the event is already registered</p>
|
952
|
+
|
953
|
+
|
954
|
+
</div>
|
955
|
+
</div>
|
956
|
+
<div class="tags">
|
957
|
+
<p class="tag_title">Parameters:</p>
|
958
|
+
<ul class="param">
|
959
|
+
|
960
|
+
<li>
|
961
|
+
|
962
|
+
<span class='name'>event_name</span>
|
963
|
+
|
964
|
+
|
965
|
+
<span class='type'>(<tt>String</tt>)</span>
|
966
|
+
|
967
|
+
|
968
|
+
|
969
|
+
—
|
970
|
+
<div class='inline'>
|
971
|
+
<p>Event name</p>
|
972
|
+
</div>
|
973
|
+
|
974
|
+
</li>
|
975
|
+
|
976
|
+
<li>
|
977
|
+
|
978
|
+
<span class='name'>payload</span>
|
979
|
+
|
980
|
+
|
981
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
982
|
+
|
983
|
+
|
984
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
985
|
+
|
986
|
+
|
987
|
+
—
|
988
|
+
<div class='inline'>
|
989
|
+
<p>Event payload</p>
|
990
|
+
</div>
|
991
|
+
|
992
|
+
</li>
|
993
|
+
|
994
|
+
</ul>
|
995
|
+
|
996
|
+
|
997
|
+
</div><table class="source_code">
|
998
|
+
<tr>
|
999
|
+
<td>
|
1000
|
+
<pre class="lines">
|
1001
|
+
|
1002
|
+
|
1003
|
+
559
|
1004
|
+
560
|
1005
|
+
561
|
1006
|
+
562
|
1007
|
+
563
|
1008
|
+
564
|
1009
|
+
565
|
1010
|
+
566
|
1011
|
+
567
|
1012
|
+
568
|
1013
|
+
569
|
1014
|
+
570
|
1015
|
+
571
|
1016
|
+
572</pre>
|
1017
|
+
</td>
|
1018
|
+
<td>
|
1019
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 559</span>
|
1020
|
+
|
1021
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_custom_event'>publish_custom_event</span><span class='lparen'>(</span><span class='id identifier rubyid_event_name'>event_name</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1022
|
+
<span class='comment'># Add standard metadata
|
1023
|
+
</span> <span class='id identifier rubyid_enhanced_payload'>enhanced_payload</span> <span class='op'>=</span> <span class='id identifier rubyid_payload'>payload</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
1024
|
+
<span class='label'>event_type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>custom</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
1025
|
+
<span class='label'>timestamp:</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span>
|
1026
|
+
<span class='rparen'>)</span>
|
1027
|
+
|
1028
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='id identifier rubyid_event_name'>event_name</span><span class='comma'>,</span> <span class='id identifier rubyid_enhanced_payload'>enhanced_payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1029
|
+
<span class='id identifier rubyid_log_structured'>log_structured</span><span class='lparen'>(</span><span class='symbol'>:info</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Custom event published</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
1030
|
+
<span class='label'>event_name:</span> <span class='id identifier rubyid_event_name'>event_name</span><span class='comma'>,</span>
|
1031
|
+
<span class='label'>event_type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>custom</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
1032
|
+
<span class='op'>**</span><span class='id identifier rubyid_payload'>payload</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:task_id</span><span class='comma'>,</span> <span class='symbol'>:step_id</span><span class='comma'>,</span> <span class='symbol'>:operation</span><span class='comma'>,</span> <span class='symbol'>:context</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1033
|
+
<span class='kw'>end</span>
|
1034
|
+
<span class='kw'>end</span></pre>
|
1035
|
+
</td>
|
1036
|
+
</tr>
|
1037
|
+
</table>
|
1038
|
+
</div>
|
1039
|
+
|
1040
|
+
<div class="method_details ">
|
1041
|
+
<h3 class="signature " id="publish_no_viable_steps-instance_method">
|
1042
|
+
|
1043
|
+
#<strong>publish_no_viable_steps</strong>(task_id, reason: 'No steps ready for execution', **context) ⇒ <tt>void</tt>
|
1044
|
+
|
1045
|
+
|
1046
|
+
|
1047
|
+
|
1048
|
+
|
1049
|
+
</h3><div class="docstring">
|
1050
|
+
<div class="discussion">
|
1051
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1052
|
+
<p>Publish no viable steps event Automatically resolves to WorkflowEvents::NO_VIABLE_STEPS</p>
|
1053
|
+
|
1054
|
+
|
1055
|
+
</div>
|
1056
|
+
</div>
|
1057
|
+
<div class="tags">
|
1058
|
+
<p class="tag_title">Parameters:</p>
|
1059
|
+
<ul class="param">
|
1060
|
+
|
1061
|
+
<li>
|
1062
|
+
|
1063
|
+
<span class='name'>task_id</span>
|
1064
|
+
|
1065
|
+
|
1066
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1067
|
+
|
1068
|
+
|
1069
|
+
|
1070
|
+
—
|
1071
|
+
<div class='inline'>
|
1072
|
+
<p>The task ID</p>
|
1073
|
+
</div>
|
1074
|
+
|
1075
|
+
</li>
|
1076
|
+
|
1077
|
+
<li>
|
1078
|
+
|
1079
|
+
<span class='name'>reason</span>
|
1080
|
+
|
1081
|
+
|
1082
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1083
|
+
|
1084
|
+
|
1085
|
+
<em class="default">(defaults to: <tt>'No steps ready for execution'</tt>)</em>
|
1086
|
+
|
1087
|
+
|
1088
|
+
—
|
1089
|
+
<div class='inline'>
|
1090
|
+
<p>The reason why no steps are viable</p>
|
1091
|
+
</div>
|
1092
|
+
|
1093
|
+
</li>
|
1094
|
+
|
1095
|
+
<li>
|
1096
|
+
|
1097
|
+
<span class='name'>context</span>
|
1098
|
+
|
1099
|
+
|
1100
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1101
|
+
|
1102
|
+
|
1103
|
+
|
1104
|
+
—
|
1105
|
+
<div class='inline'>
|
1106
|
+
<p>Additional orchestration context</p>
|
1107
|
+
</div>
|
1108
|
+
|
1109
|
+
</li>
|
1110
|
+
|
1111
|
+
</ul>
|
1112
|
+
|
1113
|
+
|
1114
|
+
</div><table class="source_code">
|
1115
|
+
<tr>
|
1116
|
+
<td>
|
1117
|
+
<pre class="lines">
|
1118
|
+
|
1119
|
+
|
1120
|
+
272
|
1121
|
+
273
|
1122
|
+
274
|
1123
|
+
275
|
1124
|
+
276
|
1125
|
+
277
|
1126
|
+
278</pre>
|
1127
|
+
</td>
|
1128
|
+
<td>
|
1129
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 272</span>
|
1130
|
+
|
1131
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_no_viable_steps'>publish_no_viable_steps</span><span class='lparen'>(</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='label'>reason:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>No steps ready for execution</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1132
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>task_id:</span> <span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='label'>reason:</span> <span class='id identifier rubyid_reason'>reason</span><span class='rparen'>)</span>
|
1133
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:no_viable_steps</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1134
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#NO_VIABLE_STEPS-constant" title="Tasker::Constants::WorkflowEvents::NO_VIABLE_STEPS (constant)">NO_VIABLE_STEPS</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1135
|
+
<span class='id identifier rubyid_log_orchestration_event'>log_orchestration_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>no_viable_steps</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:detected</span><span class='comma'>,</span> <span class='label'>task_id:</span> <span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='label'>reason:</span> <span class='id identifier rubyid_reason'>reason</span><span class='rparen'>)</span>
|
1136
|
+
<span class='kw'>end</span>
|
1137
|
+
<span class='kw'>end</span></pre>
|
1138
|
+
</td>
|
1139
|
+
</tr>
|
1140
|
+
</table>
|
1141
|
+
</div>
|
1142
|
+
|
1143
|
+
<div class="method_details ">
|
1144
|
+
<h3 class="signature " id="publish_step_backoff-instance_method">
|
1145
|
+
|
1146
|
+
#<strong>publish_step_backoff</strong>(step, backoff_seconds:, backoff_type: 'exponential', **context) ⇒ <tt>void</tt>
|
1147
|
+
|
1148
|
+
|
1149
|
+
|
1150
|
+
|
1151
|
+
|
1152
|
+
</h3><div class="docstring">
|
1153
|
+
<div class="discussion">
|
1154
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1155
|
+
<p>Publish step backoff event (for retry/rate limiting scenarios) Automatically resolves to ObservabilityEvents::Step::BACKOFF</p>
|
1156
|
+
|
1157
|
+
|
1158
|
+
</div>
|
1159
|
+
</div>
|
1160
|
+
<div class="tags">
|
1161
|
+
<p class="tag_title">Parameters:</p>
|
1162
|
+
<ul class="param">
|
1163
|
+
|
1164
|
+
<li>
|
1165
|
+
|
1166
|
+
<span class='name'>step</span>
|
1167
|
+
|
1168
|
+
|
1169
|
+
<span class='type'>(<tt><span class='object_link'><a href="../WorkflowStep.html" title="Tasker::WorkflowStep (class)">WorkflowStep</a></span></tt>)</span>
|
1170
|
+
|
1171
|
+
|
1172
|
+
|
1173
|
+
—
|
1174
|
+
<div class='inline'>
|
1175
|
+
<p>The step being backed off</p>
|
1176
|
+
</div>
|
1177
|
+
|
1178
|
+
</li>
|
1179
|
+
|
1180
|
+
<li>
|
1181
|
+
|
1182
|
+
<span class='name'>backoff_seconds</span>
|
1183
|
+
|
1184
|
+
|
1185
|
+
<span class='type'>(<tt>Float</tt>)</span>
|
1186
|
+
|
1187
|
+
|
1188
|
+
|
1189
|
+
—
|
1190
|
+
<div class='inline'>
|
1191
|
+
<p>Number of seconds to wait</p>
|
1192
|
+
</div>
|
1193
|
+
|
1194
|
+
</li>
|
1195
|
+
|
1196
|
+
<li>
|
1197
|
+
|
1198
|
+
<span class='name'>backoff_type</span>
|
1199
|
+
|
1200
|
+
|
1201
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1202
|
+
|
1203
|
+
|
1204
|
+
<em class="default">(defaults to: <tt>'exponential'</tt>)</em>
|
1205
|
+
|
1206
|
+
|
1207
|
+
—
|
1208
|
+
<div class='inline'>
|
1209
|
+
<p>Type of backoff (server_requested/exponential)</p>
|
1210
|
+
</div>
|
1211
|
+
|
1212
|
+
</li>
|
1213
|
+
|
1214
|
+
<li>
|
1215
|
+
|
1216
|
+
<span class='name'>context</span>
|
1217
|
+
|
1218
|
+
|
1219
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1220
|
+
|
1221
|
+
|
1222
|
+
|
1223
|
+
—
|
1224
|
+
<div class='inline'>
|
1225
|
+
<p>Additional backoff context</p>
|
1226
|
+
</div>
|
1227
|
+
|
1228
|
+
</li>
|
1229
|
+
|
1230
|
+
</ul>
|
1231
|
+
|
1232
|
+
|
1233
|
+
</div><table class="source_code">
|
1234
|
+
<tr>
|
1235
|
+
<td>
|
1236
|
+
<pre class="lines">
|
1237
|
+
|
1238
|
+
|
1239
|
+
509
|
1240
|
+
510
|
1241
|
+
511
|
1242
|
+
512
|
1243
|
+
513
|
1244
|
+
514
|
1245
|
+
515
|
1246
|
+
516
|
1247
|
+
517
|
1248
|
+
518
|
1249
|
+
519
|
1250
|
+
520
|
1251
|
+
521
|
1252
|
+
522
|
1253
|
+
523
|
1254
|
+
524</pre>
|
1255
|
+
</td>
|
1256
|
+
<td>
|
1257
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 509</span>
|
1258
|
+
|
1259
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_step_backoff'>publish_step_backoff</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='label'>backoff_seconds:</span><span class='comma'>,</span> <span class='label'>backoff_type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>exponential</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1260
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
1261
|
+
<span class='label'>step_id:</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_workflow_step_id'>workflow_step_id</span><span class='comma'>,</span>
|
1262
|
+
<span class='label'>step_name:</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
1263
|
+
<span class='label'>backoff_seconds:</span> <span class='id identifier rubyid_backoff_seconds'>backoff_seconds</span><span class='comma'>,</span>
|
1264
|
+
<span class='label'>backoff_type:</span> <span class='id identifier rubyid_backoff_type'>backoff_type</span>
|
1265
|
+
<span class='rparen'>)</span>
|
1266
|
+
|
1267
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_step_payload'>build_step_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:backoff</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1268
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/ObservabilityEvents.html" title="Tasker::Constants::ObservabilityEvents (module)">ObservabilityEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/ObservabilityEvents/Step.html" title="Tasker::Constants::ObservabilityEvents::Step (module)">Step</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/ObservabilityEvents/Step.html#BACKOFF-constant" title="Tasker::Constants::ObservabilityEvents::Step::BACKOFF (constant)">BACKOFF</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1269
|
+
<span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:backoff</span><span class='comma'>,</span>
|
1270
|
+
<span class='label'>backoff_seconds:</span> <span class='id identifier rubyid_backoff_seconds'>backoff_seconds</span><span class='comma'>,</span>
|
1271
|
+
<span class='label'>backoff_type:</span> <span class='id identifier rubyid_backoff_type'>backoff_type</span><span class='comma'>,</span>
|
1272
|
+
<span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:retry_attempt</span><span class='comma'>,</span> <span class='symbol'>:max_retries</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1273
|
+
<span class='kw'>end</span>
|
1274
|
+
<span class='kw'>end</span></pre>
|
1275
|
+
</td>
|
1276
|
+
</tr>
|
1277
|
+
</table>
|
1278
|
+
</div>
|
1279
|
+
|
1280
|
+
<div class="method_details ">
|
1281
|
+
<h3 class="signature " id="publish_step_before_handle-instance_method">
|
1282
|
+
|
1283
|
+
#<strong>publish_step_before_handle</strong>(step, **context) ⇒ <tt>void</tt>
|
1284
|
+
|
1285
|
+
|
1286
|
+
|
1287
|
+
|
1288
|
+
|
1289
|
+
</h3><div class="docstring">
|
1290
|
+
<div class="discussion">
|
1291
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1292
|
+
<p>Publish step before handle event Automatically resolves to StepEvents::BEFORE_HANDLE with :before_handle event type</p>
|
1293
|
+
|
1294
|
+
|
1295
|
+
</div>
|
1296
|
+
</div>
|
1297
|
+
<div class="tags">
|
1298
|
+
<p class="tag_title">Parameters:</p>
|
1299
|
+
<ul class="param">
|
1300
|
+
|
1301
|
+
<li>
|
1302
|
+
|
1303
|
+
<span class='name'>step</span>
|
1304
|
+
|
1305
|
+
|
1306
|
+
<span class='type'>(<tt><span class='object_link'><a href="../WorkflowStep.html" title="Tasker::WorkflowStep (class)">WorkflowStep</a></span></tt>)</span>
|
1307
|
+
|
1308
|
+
|
1309
|
+
|
1310
|
+
—
|
1311
|
+
<div class='inline'>
|
1312
|
+
<p>The step about to be handled</p>
|
1313
|
+
</div>
|
1314
|
+
|
1315
|
+
</li>
|
1316
|
+
|
1317
|
+
<li>
|
1318
|
+
|
1319
|
+
<span class='name'>context</span>
|
1320
|
+
|
1321
|
+
|
1322
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1323
|
+
|
1324
|
+
|
1325
|
+
|
1326
|
+
—
|
1327
|
+
<div class='inline'>
|
1328
|
+
<p>Additional context to merge into payload</p>
|
1329
|
+
</div>
|
1330
|
+
|
1331
|
+
</li>
|
1332
|
+
|
1333
|
+
</ul>
|
1334
|
+
|
1335
|
+
|
1336
|
+
</div><table class="source_code">
|
1337
|
+
<tr>
|
1338
|
+
<td>
|
1339
|
+
<pre class="lines">
|
1340
|
+
|
1341
|
+
|
1342
|
+
60
|
1343
|
+
61
|
1344
|
+
62
|
1345
|
+
63
|
1346
|
+
64
|
1347
|
+
65</pre>
|
1348
|
+
</td>
|
1349
|
+
<td>
|
1350
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 60</span>
|
1351
|
+
|
1352
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_step_before_handle'>publish_step_before_handle</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1353
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_step_payload'>build_step_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:before_handle</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1354
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html" title="Tasker::Constants::StepEvents (module)">StepEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html#BEFORE_HANDLE-constant" title="Tasker::Constants::StepEvents::BEFORE_HANDLE (constant)">BEFORE_HANDLE</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1355
|
+
<span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:before_handle</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:handler_class</span><span class='comma'>,</span> <span class='symbol'>:dependencies_met</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1356
|
+
<span class='kw'>end</span>
|
1357
|
+
<span class='kw'>end</span></pre>
|
1358
|
+
</td>
|
1359
|
+
</tr>
|
1360
|
+
</table>
|
1361
|
+
</div>
|
1362
|
+
|
1363
|
+
<div class="method_details ">
|
1364
|
+
<h3 class="signature " id="publish_step_cancelled-instance_method">
|
1365
|
+
|
1366
|
+
#<strong>publish_step_cancelled</strong>(step, cancellation_reason: 'Step cancelled', **context) ⇒ <tt>void</tt>
|
1367
|
+
|
1368
|
+
|
1369
|
+
|
1370
|
+
|
1371
|
+
|
1372
|
+
</h3><div class="docstring">
|
1373
|
+
<div class="discussion">
|
1374
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1375
|
+
<p>Publish step cancelled event Automatically resolves to StepEvents::CANCELLED with :cancelled event type</p>
|
1376
|
+
|
1377
|
+
|
1378
|
+
</div>
|
1379
|
+
</div>
|
1380
|
+
<div class="tags">
|
1381
|
+
<p class="tag_title">Parameters:</p>
|
1382
|
+
<ul class="param">
|
1383
|
+
|
1384
|
+
<li>
|
1385
|
+
|
1386
|
+
<span class='name'>step</span>
|
1387
|
+
|
1388
|
+
|
1389
|
+
<span class='type'>(<tt><span class='object_link'><a href="../WorkflowStep.html" title="Tasker::WorkflowStep (class)">WorkflowStep</a></span></tt>)</span>
|
1390
|
+
|
1391
|
+
|
1392
|
+
|
1393
|
+
—
|
1394
|
+
<div class='inline'>
|
1395
|
+
<p>The step being cancelled</p>
|
1396
|
+
</div>
|
1397
|
+
|
1398
|
+
</li>
|
1399
|
+
|
1400
|
+
<li>
|
1401
|
+
|
1402
|
+
<span class='name'>cancellation_reason</span>
|
1403
|
+
|
1404
|
+
|
1405
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1406
|
+
|
1407
|
+
|
1408
|
+
<em class="default">(defaults to: <tt>'Step cancelled'</tt>)</em>
|
1409
|
+
|
1410
|
+
|
1411
|
+
—
|
1412
|
+
<div class='inline'>
|
1413
|
+
<p>The reason for cancellation</p>
|
1414
|
+
</div>
|
1415
|
+
|
1416
|
+
</li>
|
1417
|
+
|
1418
|
+
<li>
|
1419
|
+
|
1420
|
+
<span class='name'>context</span>
|
1421
|
+
|
1422
|
+
|
1423
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1424
|
+
|
1425
|
+
|
1426
|
+
|
1427
|
+
—
|
1428
|
+
<div class='inline'>
|
1429
|
+
<p>Additional context to merge into payload</p>
|
1430
|
+
</div>
|
1431
|
+
|
1432
|
+
</li>
|
1433
|
+
|
1434
|
+
</ul>
|
1435
|
+
|
1436
|
+
|
1437
|
+
</div><table class="source_code">
|
1438
|
+
<tr>
|
1439
|
+
<td>
|
1440
|
+
<pre class="lines">
|
1441
|
+
|
1442
|
+
|
1443
|
+
132
|
1444
|
+
133
|
1445
|
+
134
|
1446
|
+
135
|
1447
|
+
136
|
1448
|
+
137
|
1449
|
+
138</pre>
|
1450
|
+
</td>
|
1451
|
+
<td>
|
1452
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 132</span>
|
1453
|
+
|
1454
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_step_cancelled'>publish_step_cancelled</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='label'>cancellation_reason:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Step cancelled</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1455
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>cancellation_reason:</span> <span class='id identifier rubyid_cancellation_reason'>cancellation_reason</span><span class='rparen'>)</span>
|
1456
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_step_payload'>build_step_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:cancelled</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1457
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html" title="Tasker::Constants::StepEvents (module)">StepEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html#CANCELLED-constant" title="Tasker::Constants::StepEvents::CANCELLED (constant)">CANCELLED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1458
|
+
<span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:cancelled</span><span class='comma'>,</span> <span class='label'>cancellation_reason:</span> <span class='id identifier rubyid_cancellation_reason'>cancellation_reason</span><span class='rparen'>)</span>
|
1459
|
+
<span class='kw'>end</span>
|
1460
|
+
<span class='kw'>end</span></pre>
|
1461
|
+
</td>
|
1462
|
+
</tr>
|
1463
|
+
</table>
|
1464
|
+
</div>
|
1465
|
+
|
1466
|
+
<div class="method_details ">
|
1467
|
+
<h3 class="signature " id="publish_step_completed-instance_method">
|
1468
|
+
|
1469
|
+
#<strong>publish_step_completed</strong>(step, **context) ⇒ <tt>void</tt>
|
1470
|
+
|
1471
|
+
|
1472
|
+
|
1473
|
+
|
1474
|
+
|
1475
|
+
</h3><div class="docstring">
|
1476
|
+
<div class="discussion">
|
1477
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1478
|
+
<p>Publish step completed event Automatically resolves to StepEvents::COMPLETED with :completed event type</p>
|
1479
|
+
|
1480
|
+
|
1481
|
+
</div>
|
1482
|
+
</div>
|
1483
|
+
<div class="tags">
|
1484
|
+
<p class="tag_title">Parameters:</p>
|
1485
|
+
<ul class="param">
|
1486
|
+
|
1487
|
+
<li>
|
1488
|
+
|
1489
|
+
<span class='name'>step</span>
|
1490
|
+
|
1491
|
+
|
1492
|
+
<span class='type'>(<tt><span class='object_link'><a href="../WorkflowStep.html" title="Tasker::WorkflowStep (class)">WorkflowStep</a></span></tt>)</span>
|
1493
|
+
|
1494
|
+
|
1495
|
+
|
1496
|
+
—
|
1497
|
+
<div class='inline'>
|
1498
|
+
<p>The step that completed</p>
|
1499
|
+
</div>
|
1500
|
+
|
1501
|
+
</li>
|
1502
|
+
|
1503
|
+
<li>
|
1504
|
+
|
1505
|
+
<span class='name'>context</span>
|
1506
|
+
|
1507
|
+
|
1508
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1509
|
+
|
1510
|
+
|
1511
|
+
|
1512
|
+
—
|
1513
|
+
<div class='inline'>
|
1514
|
+
<p>Additional context to merge into payload</p>
|
1515
|
+
</div>
|
1516
|
+
|
1517
|
+
</li>
|
1518
|
+
|
1519
|
+
</ul>
|
1520
|
+
|
1521
|
+
|
1522
|
+
</div><table class="source_code">
|
1523
|
+
<tr>
|
1524
|
+
<td>
|
1525
|
+
<pre class="lines">
|
1526
|
+
|
1527
|
+
|
1528
|
+
73
|
1529
|
+
74
|
1530
|
+
75
|
1531
|
+
76
|
1532
|
+
77
|
1533
|
+
78
|
1534
|
+
79</pre>
|
1535
|
+
</td>
|
1536
|
+
<td>
|
1537
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 73</span>
|
1538
|
+
|
1539
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_step_completed'>publish_step_completed</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1540
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_step_payload'>build_step_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:completed</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1541
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html" title="Tasker::Constants::StepEvents (module)">StepEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html#COMPLETED-constant" title="Tasker::Constants::StepEvents::COMPLETED (constant)">COMPLETED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1542
|
+
<span class='id identifier rubyid_duration'>duration</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='lbracket'>[</span><span class='symbol'>:duration</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_extract_duration_from_step'>extract_duration_from_step</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='rparen'>)</span>
|
1543
|
+
<span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:completed</span><span class='comma'>,</span> <span class='label'>duration:</span> <span class='id identifier rubyid_duration'>duration</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:operation_count</span><span class='comma'>,</span> <span class='symbol'>:records_processed</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1544
|
+
<span class='kw'>end</span>
|
1545
|
+
<span class='kw'>end</span></pre>
|
1546
|
+
</td>
|
1547
|
+
</tr>
|
1548
|
+
</table>
|
1549
|
+
</div>
|
1550
|
+
|
1551
|
+
<div class="method_details ">
|
1552
|
+
<h3 class="signature " id="publish_step_event_for_context-instance_method">
|
1553
|
+
|
1554
|
+
#<strong>publish_step_event_for_context</strong>(step, context_hint: nil, **context) ⇒ <tt>void</tt>
|
1555
|
+
|
1556
|
+
|
1557
|
+
|
1558
|
+
|
1559
|
+
|
1560
|
+
</h3><div class="docstring">
|
1561
|
+
<div class="discussion">
|
1562
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1563
|
+
<p>Automatically determine and publish the appropriate step event based on step state This method uses the step’s current state to infer the most appropriate event type</p>
|
1564
|
+
|
1565
|
+
|
1566
|
+
</div>
|
1567
|
+
</div>
|
1568
|
+
<div class="tags">
|
1569
|
+
<p class="tag_title">Parameters:</p>
|
1570
|
+
<ul class="param">
|
1571
|
+
|
1572
|
+
<li>
|
1573
|
+
|
1574
|
+
<span class='name'>step</span>
|
1575
|
+
|
1576
|
+
|
1577
|
+
<span class='type'>(<tt><span class='object_link'><a href="../WorkflowStep.html" title="Tasker::WorkflowStep (class)">WorkflowStep</a></span></tt>)</span>
|
1578
|
+
|
1579
|
+
|
1580
|
+
|
1581
|
+
—
|
1582
|
+
<div class='inline'>
|
1583
|
+
<p>The step object</p>
|
1584
|
+
</div>
|
1585
|
+
|
1586
|
+
</li>
|
1587
|
+
|
1588
|
+
<li>
|
1589
|
+
|
1590
|
+
<span class='name'>context_hint</span>
|
1591
|
+
|
1592
|
+
|
1593
|
+
<span class='type'>(<tt>Symbol</tt>, <tt>nil</tt>)</span>
|
1594
|
+
|
1595
|
+
|
1596
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1597
|
+
|
1598
|
+
|
1599
|
+
—
|
1600
|
+
<div class='inline'>
|
1601
|
+
<p>Optional hint about the context</p>
|
1602
|
+
</div>
|
1603
|
+
|
1604
|
+
</li>
|
1605
|
+
|
1606
|
+
<li>
|
1607
|
+
|
1608
|
+
<span class='name'>context</span>
|
1609
|
+
|
1610
|
+
|
1611
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1612
|
+
|
1613
|
+
|
1614
|
+
|
1615
|
+
—
|
1616
|
+
<div class='inline'>
|
1617
|
+
<p>Additional context to merge into payload</p>
|
1618
|
+
</div>
|
1619
|
+
|
1620
|
+
</li>
|
1621
|
+
|
1622
|
+
</ul>
|
1623
|
+
|
1624
|
+
|
1625
|
+
</div><table class="source_code">
|
1626
|
+
<tr>
|
1627
|
+
<td>
|
1628
|
+
<pre class="lines">
|
1629
|
+
|
1630
|
+
|
1631
|
+
585
|
1632
|
+
586
|
1633
|
+
587
|
1634
|
+
588
|
1635
|
+
589
|
1636
|
+
590
|
1637
|
+
591
|
1638
|
+
592
|
1639
|
+
593
|
1640
|
+
594
|
1641
|
+
595
|
1642
|
+
596
|
1643
|
+
597
|
1644
|
+
598
|
1645
|
+
599
|
1646
|
+
600
|
1647
|
+
601
|
1648
|
+
602</pre>
|
1649
|
+
</td>
|
1650
|
+
<td>
|
1651
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 585</span>
|
1652
|
+
|
1653
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_step_event_for_context'>publish_step_event_for_context</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='label'>context_hint:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1654
|
+
<span class='id identifier rubyid_event_type'>event_type</span> <span class='op'>=</span> <span class='id identifier rubyid_context_hint'>context_hint</span> <span class='op'>||</span> <span class='id identifier rubyid_infer_step_event_type_from_state'>infer_step_event_type_from_state</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='rparen'>)</span>
|
1655
|
+
|
1656
|
+
<span class='kw'>case</span> <span class='id identifier rubyid_event_type'>event_type</span>
|
1657
|
+
<span class='kw'>when</span> <span class='symbol'>:started</span><span class='comma'>,</span> <span class='symbol'>:execution_requested</span>
|
1658
|
+
<span class='id identifier rubyid_publish_step_started'>publish_step_started</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1659
|
+
<span class='kw'>when</span> <span class='symbol'>:completed</span><span class='comma'>,</span> <span class='symbol'>:success</span>
|
1660
|
+
<span class='id identifier rubyid_publish_step_completed'>publish_step_completed</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1661
|
+
<span class='kw'>when</span> <span class='symbol'>:failed</span><span class='comma'>,</span> <span class='symbol'>:failure</span><span class='comma'>,</span> <span class='symbol'>:error</span>
|
1662
|
+
<span class='id identifier rubyid_publish_step_failed'>publish_step_failed</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1663
|
+
<span class='kw'>when</span> <span class='symbol'>:retry</span><span class='comma'>,</span> <span class='symbol'>:retry_requested</span>
|
1664
|
+
<span class='id identifier rubyid_publish_step_retry_requested'>publish_step_retry_requested</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1665
|
+
<span class='kw'>when</span> <span class='symbol'>:cancelled</span>
|
1666
|
+
<span class='id identifier rubyid_publish_step_cancelled'>publish_step_cancelled</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1667
|
+
<span class='kw'>else</span>
|
1668
|
+
<span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unknown step event context: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_event_type'>event_type</span><span class='embexpr_end'>}</span><span class='tstring_content'> for step </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_workflow_step_id'>workflow_step_id</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
1669
|
+
<span class='kw'>end</span>
|
1670
|
+
<span class='kw'>end</span></pre>
|
1671
|
+
</td>
|
1672
|
+
</tr>
|
1673
|
+
</table>
|
1674
|
+
</div>
|
1675
|
+
|
1676
|
+
<div class="method_details ">
|
1677
|
+
<h3 class="signature " id="publish_step_failed-instance_method">
|
1678
|
+
|
1679
|
+
#<strong>publish_step_failed</strong>(step, error: nil, **context) ⇒ <tt>void</tt>
|
1680
|
+
|
1681
|
+
|
1682
|
+
|
1683
|
+
|
1684
|
+
|
1685
|
+
</h3><div class="docstring">
|
1686
|
+
<div class="discussion">
|
1687
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1688
|
+
<p>Publish step failed event Automatically resolves to StepEvents::FAILED with :failed event type Automatically extracts error information if :error is provided</p>
|
1689
|
+
|
1690
|
+
|
1691
|
+
</div>
|
1692
|
+
</div>
|
1693
|
+
<div class="tags">
|
1694
|
+
<p class="tag_title">Parameters:</p>
|
1695
|
+
<ul class="param">
|
1696
|
+
|
1697
|
+
<li>
|
1698
|
+
|
1699
|
+
<span class='name'>step</span>
|
1700
|
+
|
1701
|
+
|
1702
|
+
<span class='type'>(<tt><span class='object_link'><a href="../WorkflowStep.html" title="Tasker::WorkflowStep (class)">WorkflowStep</a></span></tt>)</span>
|
1703
|
+
|
1704
|
+
|
1705
|
+
|
1706
|
+
—
|
1707
|
+
<div class='inline'>
|
1708
|
+
<p>The step that failed</p>
|
1709
|
+
</div>
|
1710
|
+
|
1711
|
+
</li>
|
1712
|
+
|
1713
|
+
<li>
|
1714
|
+
|
1715
|
+
<span class='name'>error</span>
|
1716
|
+
|
1717
|
+
|
1718
|
+
<span class='type'>(<tt>Exception</tt>, <tt>nil</tt>)</span>
|
1719
|
+
|
1720
|
+
|
1721
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1722
|
+
|
1723
|
+
|
1724
|
+
—
|
1725
|
+
<div class='inline'>
|
1726
|
+
<p>The exception that caused the failure</p>
|
1727
|
+
</div>
|
1728
|
+
|
1729
|
+
</li>
|
1730
|
+
|
1731
|
+
<li>
|
1732
|
+
|
1733
|
+
<span class='name'>context</span>
|
1734
|
+
|
1735
|
+
|
1736
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1737
|
+
|
1738
|
+
|
1739
|
+
|
1740
|
+
—
|
1741
|
+
<div class='inline'>
|
1742
|
+
<p>Additional context to merge into payload</p>
|
1743
|
+
</div>
|
1744
|
+
|
1745
|
+
</li>
|
1746
|
+
|
1747
|
+
</ul>
|
1748
|
+
|
1749
|
+
|
1750
|
+
</div><table class="source_code">
|
1751
|
+
<tr>
|
1752
|
+
<td>
|
1753
|
+
<pre class="lines">
|
1754
|
+
|
1755
|
+
|
1756
|
+
89
|
1757
|
+
90
|
1758
|
+
91
|
1759
|
+
92
|
1760
|
+
93
|
1761
|
+
94
|
1762
|
+
95
|
1763
|
+
96
|
1764
|
+
97
|
1765
|
+
98
|
1766
|
+
99
|
1767
|
+
100
|
1768
|
+
101
|
1769
|
+
102
|
1770
|
+
103
|
1771
|
+
104
|
1772
|
+
105</pre>
|
1773
|
+
</td>
|
1774
|
+
<td>
|
1775
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 89</span>
|
1776
|
+
|
1777
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_step_failed'>publish_step_failed</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1778
|
+
<span class='comment'># Automatically extract error information into context
|
1779
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_error'>error</span>
|
1780
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
1781
|
+
<span class='label'>error_message:</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span>
|
1782
|
+
<span class='label'>error_class:</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
1783
|
+
<span class='label'>backtrace:</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span><span class='op'>&.</span><span class='id identifier rubyid_first'>first</span><span class='lparen'>(</span><span class='int'>10</span><span class='rparen'>)</span>
|
1784
|
+
<span class='rparen'>)</span>
|
1785
|
+
<span class='kw'>end</span>
|
1786
|
+
|
1787
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_step_payload'>build_step_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:failed</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1788
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html" title="Tasker::Constants::StepEvents (module)">StepEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html#FAILED-constant" title="Tasker::Constants::StepEvents::FAILED (constant)">FAILED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1789
|
+
<span class='id identifier rubyid_duration'>duration</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='lbracket'>[</span><span class='symbol'>:duration</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_extract_duration_from_step'>extract_duration_from_step</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='rparen'>)</span>
|
1790
|
+
<span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:failed</span><span class='comma'>,</span> <span class='label'>duration:</span> <span class='id identifier rubyid_duration'>duration</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_error'>error</span><span class='op'>&.</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span>
|
1791
|
+
<span class='id identifier rubyid_log_exception'>log_exception</span><span class='lparen'>(</span><span class='id identifier rubyid_error'>error</span><span class='comma'>,</span> <span class='label'>context:</span> <span class='lbrace'>{</span> <span class='label'>step_id:</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_workflow_step_id'>workflow_step_id</span><span class='comma'>,</span> <span class='label'>task_id:</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span> <span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_error'>error</span>
|
1792
|
+
<span class='kw'>end</span>
|
1793
|
+
<span class='kw'>end</span></pre>
|
1794
|
+
</td>
|
1795
|
+
</tr>
|
1796
|
+
</table>
|
1797
|
+
</div>
|
1798
|
+
|
1799
|
+
<div class="method_details ">
|
1800
|
+
<h3 class="signature " id="publish_step_retry_requested-instance_method">
|
1801
|
+
|
1802
|
+
#<strong>publish_step_retry_requested</strong>(step, retry_reason: 'Step execution failed', **context) ⇒ <tt>void</tt>
|
1803
|
+
|
1804
|
+
|
1805
|
+
|
1806
|
+
|
1807
|
+
|
1808
|
+
</h3><div class="docstring">
|
1809
|
+
<div class="discussion">
|
1810
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1811
|
+
<p>Publish step retry requested event Automatically resolves to StepEvents::RETRY_REQUESTED with :retry event type</p>
|
1812
|
+
|
1813
|
+
|
1814
|
+
</div>
|
1815
|
+
</div>
|
1816
|
+
<div class="tags">
|
1817
|
+
<p class="tag_title">Parameters:</p>
|
1818
|
+
<ul class="param">
|
1819
|
+
|
1820
|
+
<li>
|
1821
|
+
|
1822
|
+
<span class='name'>step</span>
|
1823
|
+
|
1824
|
+
|
1825
|
+
<span class='type'>(<tt><span class='object_link'><a href="../WorkflowStep.html" title="Tasker::WorkflowStep (class)">WorkflowStep</a></span></tt>)</span>
|
1826
|
+
|
1827
|
+
|
1828
|
+
|
1829
|
+
—
|
1830
|
+
<div class='inline'>
|
1831
|
+
<p>The step being retried</p>
|
1832
|
+
</div>
|
1833
|
+
|
1834
|
+
</li>
|
1835
|
+
|
1836
|
+
<li>
|
1837
|
+
|
1838
|
+
<span class='name'>retry_reason</span>
|
1839
|
+
|
1840
|
+
|
1841
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1842
|
+
|
1843
|
+
|
1844
|
+
<em class="default">(defaults to: <tt>'Step execution failed'</tt>)</em>
|
1845
|
+
|
1846
|
+
|
1847
|
+
—
|
1848
|
+
<div class='inline'>
|
1849
|
+
<p>The reason for the retry</p>
|
1850
|
+
</div>
|
1851
|
+
|
1852
|
+
</li>
|
1853
|
+
|
1854
|
+
<li>
|
1855
|
+
|
1856
|
+
<span class='name'>context</span>
|
1857
|
+
|
1858
|
+
|
1859
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1860
|
+
|
1861
|
+
|
1862
|
+
|
1863
|
+
—
|
1864
|
+
<div class='inline'>
|
1865
|
+
<p>Additional context to merge into payload</p>
|
1866
|
+
</div>
|
1867
|
+
|
1868
|
+
</li>
|
1869
|
+
|
1870
|
+
</ul>
|
1871
|
+
|
1872
|
+
|
1873
|
+
</div><table class="source_code">
|
1874
|
+
<tr>
|
1875
|
+
<td>
|
1876
|
+
<pre class="lines">
|
1877
|
+
|
1878
|
+
|
1879
|
+
114
|
1880
|
+
115
|
1881
|
+
116
|
1882
|
+
117
|
1883
|
+
118
|
1884
|
+
119
|
1885
|
+
120
|
1886
|
+
121
|
1887
|
+
122
|
1888
|
+
123</pre>
|
1889
|
+
</td>
|
1890
|
+
<td>
|
1891
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 114</span>
|
1892
|
+
|
1893
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_step_retry_requested'>publish_step_retry_requested</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='label'>retry_reason:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Step execution failed</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1894
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>retry_reason:</span> <span class='id identifier rubyid_retry_reason'>retry_reason</span><span class='rparen'>)</span>
|
1895
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_step_payload'>build_step_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:retry</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1896
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html" title="Tasker::Constants::StepEvents (module)">StepEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html#RETRY_REQUESTED-constant" title="Tasker::Constants::StepEvents::RETRY_REQUESTED (constant)">RETRY_REQUESTED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1897
|
+
<span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:retry_requested</span><span class='comma'>,</span>
|
1898
|
+
<span class='label'>retry_reason:</span> <span class='id identifier rubyid_retry_reason'>retry_reason</span><span class='comma'>,</span>
|
1899
|
+
<span class='label'>attempt_count:</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_attempts'>attempts</span><span class='comma'>,</span>
|
1900
|
+
<span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:backoff_seconds</span><span class='comma'>,</span> <span class='symbol'>:max_retries</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1901
|
+
<span class='kw'>end</span>
|
1902
|
+
<span class='kw'>end</span></pre>
|
1903
|
+
</td>
|
1904
|
+
</tr>
|
1905
|
+
</table>
|
1906
|
+
</div>
|
1907
|
+
|
1908
|
+
<div class="method_details ">
|
1909
|
+
<h3 class="signature " id="publish_step_started-instance_method">
|
1910
|
+
|
1911
|
+
#<strong>publish_step_started</strong>(step, **context) ⇒ <tt>void</tt>
|
1912
|
+
|
1913
|
+
|
1914
|
+
|
1915
|
+
|
1916
|
+
|
1917
|
+
</h3><div class="docstring">
|
1918
|
+
<div class="discussion">
|
1919
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1920
|
+
<p>Publish step started event Automatically resolves to StepEvents::EXECUTION_REQUESTED with :started event type</p>
|
1921
|
+
|
1922
|
+
|
1923
|
+
</div>
|
1924
|
+
</div>
|
1925
|
+
<div class="tags">
|
1926
|
+
<p class="tag_title">Parameters:</p>
|
1927
|
+
<ul class="param">
|
1928
|
+
|
1929
|
+
<li>
|
1930
|
+
|
1931
|
+
<span class='name'>step</span>
|
1932
|
+
|
1933
|
+
|
1934
|
+
<span class='type'>(<tt><span class='object_link'><a href="../WorkflowStep.html" title="Tasker::WorkflowStep (class)">WorkflowStep</a></span></tt>)</span>
|
1935
|
+
|
1936
|
+
|
1937
|
+
|
1938
|
+
—
|
1939
|
+
<div class='inline'>
|
1940
|
+
<p>The step being started</p>
|
1941
|
+
</div>
|
1942
|
+
|
1943
|
+
</li>
|
1944
|
+
|
1945
|
+
<li>
|
1946
|
+
|
1947
|
+
<span class='name'>context</span>
|
1948
|
+
|
1949
|
+
|
1950
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1951
|
+
|
1952
|
+
|
1953
|
+
|
1954
|
+
—
|
1955
|
+
<div class='inline'>
|
1956
|
+
<p>Additional context to merge into payload</p>
|
1957
|
+
</div>
|
1958
|
+
|
1959
|
+
</li>
|
1960
|
+
|
1961
|
+
</ul>
|
1962
|
+
|
1963
|
+
|
1964
|
+
</div><table class="source_code">
|
1965
|
+
<tr>
|
1966
|
+
<td>
|
1967
|
+
<pre class="lines">
|
1968
|
+
|
1969
|
+
|
1970
|
+
47
|
1971
|
+
48
|
1972
|
+
49
|
1973
|
+
50
|
1974
|
+
51
|
1975
|
+
52</pre>
|
1976
|
+
</td>
|
1977
|
+
<td>
|
1978
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 47</span>
|
1979
|
+
|
1980
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_step_started'>publish_step_started</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1981
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_step_payload'>build_step_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:started</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
1982
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html" title="Tasker::Constants::StepEvents (module)">StepEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/StepEvents.html#EXECUTION_REQUESTED-constant" title="Tasker::Constants::StepEvents::EXECUTION_REQUESTED (constant)">EXECUTION_REQUESTED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
1983
|
+
<span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:started</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:processing_mode</span><span class='comma'>,</span> <span class='symbol'>:concurrent_batch_size</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
1984
|
+
<span class='kw'>end</span>
|
1985
|
+
<span class='kw'>end</span></pre>
|
1986
|
+
</td>
|
1987
|
+
</tr>
|
1988
|
+
</table>
|
1989
|
+
</div>
|
1990
|
+
|
1991
|
+
<div class="method_details ">
|
1992
|
+
<h3 class="signature " id="publish_steps_execution_completed-instance_method">
|
1993
|
+
|
1994
|
+
#<strong>publish_steps_execution_completed</strong>(task, processed_count:, successful_count:, **context) ⇒ <tt>void</tt>
|
1995
|
+
|
1996
|
+
|
1997
|
+
|
1998
|
+
|
1999
|
+
|
2000
|
+
</h3><div class="docstring">
|
2001
|
+
<div class="discussion">
|
2002
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2003
|
+
<p>Publish steps execution completed event (batch processing) Automatically resolves to WorkflowEvents::STEPS_EXECUTION_COMPLETED</p>
|
2004
|
+
|
2005
|
+
|
2006
|
+
</div>
|
2007
|
+
</div>
|
2008
|
+
<div class="tags">
|
2009
|
+
<p class="tag_title">Parameters:</p>
|
2010
|
+
<ul class="param">
|
2011
|
+
|
2012
|
+
<li>
|
2013
|
+
|
2014
|
+
<span class='name'>task</span>
|
2015
|
+
|
2016
|
+
|
2017
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
2018
|
+
|
2019
|
+
|
2020
|
+
|
2021
|
+
—
|
2022
|
+
<div class='inline'>
|
2023
|
+
<p>The task whose steps were executed</p>
|
2024
|
+
</div>
|
2025
|
+
|
2026
|
+
</li>
|
2027
|
+
|
2028
|
+
<li>
|
2029
|
+
|
2030
|
+
<span class='name'>processed_count</span>
|
2031
|
+
|
2032
|
+
|
2033
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2034
|
+
|
2035
|
+
|
2036
|
+
|
2037
|
+
—
|
2038
|
+
<div class='inline'>
|
2039
|
+
<p>Number of steps processed</p>
|
2040
|
+
</div>
|
2041
|
+
|
2042
|
+
</li>
|
2043
|
+
|
2044
|
+
<li>
|
2045
|
+
|
2046
|
+
<span class='name'>successful_count</span>
|
2047
|
+
|
2048
|
+
|
2049
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2050
|
+
|
2051
|
+
|
2052
|
+
|
2053
|
+
—
|
2054
|
+
<div class='inline'>
|
2055
|
+
<p>Number of steps that succeeded</p>
|
2056
|
+
</div>
|
2057
|
+
|
2058
|
+
</li>
|
2059
|
+
|
2060
|
+
<li>
|
2061
|
+
|
2062
|
+
<span class='name'>context</span>
|
2063
|
+
|
2064
|
+
|
2065
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2066
|
+
|
2067
|
+
|
2068
|
+
|
2069
|
+
—
|
2070
|
+
<div class='inline'>
|
2071
|
+
<p>Additional execution context</p>
|
2072
|
+
</div>
|
2073
|
+
|
2074
|
+
</li>
|
2075
|
+
|
2076
|
+
</ul>
|
2077
|
+
|
2078
|
+
|
2079
|
+
</div><table class="source_code">
|
2080
|
+
<tr>
|
2081
|
+
<td>
|
2082
|
+
<pre class="lines">
|
2083
|
+
|
2084
|
+
|
2085
|
+
479
|
2086
|
+
480
|
2087
|
+
481
|
2088
|
+
482
|
2089
|
+
483
|
2090
|
+
484
|
2091
|
+
485
|
2092
|
+
486
|
2093
|
+
487
|
2094
|
+
488
|
2095
|
+
489
|
2096
|
+
490
|
2097
|
+
491
|
2098
|
+
492
|
2099
|
+
493
|
2100
|
+
494
|
2101
|
+
495</pre>
|
2102
|
+
</td>
|
2103
|
+
<td>
|
2104
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 479</span>
|
2105
|
+
|
2106
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_steps_execution_completed'>publish_steps_execution_completed</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>processed_count:</span><span class='comma'>,</span> <span class='label'>successful_count:</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2107
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
2108
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
2109
|
+
<span class='label'>task_name:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
2110
|
+
<span class='label'>processed_count:</span> <span class='id identifier rubyid_processed_count'>processed_count</span><span class='comma'>,</span>
|
2111
|
+
<span class='label'>successful_count:</span> <span class='id identifier rubyid_successful_count'>successful_count</span>
|
2112
|
+
<span class='rparen'>)</span>
|
2113
|
+
|
2114
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:steps_execution_completed</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2115
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#STEPS_EXECUTION_COMPLETED-constant" title="Tasker::Constants::WorkflowEvents::STEPS_EXECUTION_COMPLETED (constant)">STEPS_EXECUTION_COMPLETED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
2116
|
+
<span class='id identifier rubyid_log_orchestration_event'>log_orchestration_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>steps_execution_completed</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:completed</span><span class='comma'>,</span>
|
2117
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
2118
|
+
<span class='label'>processed_count:</span> <span class='id identifier rubyid_processed_count'>processed_count</span><span class='comma'>,</span>
|
2119
|
+
<span class='label'>successful_count:</span> <span class='id identifier rubyid_successful_count'>successful_count</span><span class='comma'>,</span>
|
2120
|
+
<span class='label'>failure_count:</span> <span class='id identifier rubyid_processed_count'>processed_count</span> <span class='op'>-</span> <span class='id identifier rubyid_successful_count'>successful_count</span><span class='rparen'>)</span>
|
2121
|
+
<span class='kw'>end</span>
|
2122
|
+
<span class='kw'>end</span></pre>
|
2123
|
+
</td>
|
2124
|
+
</tr>
|
2125
|
+
</table>
|
2126
|
+
</div>
|
2127
|
+
|
2128
|
+
<div class="method_details ">
|
2129
|
+
<h3 class="signature " id="publish_steps_execution_started-instance_method">
|
2130
|
+
|
2131
|
+
#<strong>publish_steps_execution_started</strong>(task, step_count:, processing_mode: 'concurrent', **context) ⇒ <tt>void</tt>
|
2132
|
+
|
2133
|
+
|
2134
|
+
|
2135
|
+
|
2136
|
+
|
2137
|
+
</h3><div class="docstring">
|
2138
|
+
<div class="discussion">
|
2139
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2140
|
+
<p>Publish steps execution started event (batch processing) Automatically resolves to WorkflowEvents::STEPS_EXECUTION_STARTED</p>
|
2141
|
+
|
2142
|
+
|
2143
|
+
</div>
|
2144
|
+
</div>
|
2145
|
+
<div class="tags">
|
2146
|
+
<p class="tag_title">Parameters:</p>
|
2147
|
+
<ul class="param">
|
2148
|
+
|
2149
|
+
<li>
|
2150
|
+
|
2151
|
+
<span class='name'>task</span>
|
2152
|
+
|
2153
|
+
|
2154
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
2155
|
+
|
2156
|
+
|
2157
|
+
|
2158
|
+
—
|
2159
|
+
<div class='inline'>
|
2160
|
+
<p>The task whose steps are being executed</p>
|
2161
|
+
</div>
|
2162
|
+
|
2163
|
+
</li>
|
2164
|
+
|
2165
|
+
<li>
|
2166
|
+
|
2167
|
+
<span class='name'>step_count</span>
|
2168
|
+
|
2169
|
+
|
2170
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2171
|
+
|
2172
|
+
|
2173
|
+
|
2174
|
+
—
|
2175
|
+
<div class='inline'>
|
2176
|
+
<p>Number of steps being executed</p>
|
2177
|
+
</div>
|
2178
|
+
|
2179
|
+
</li>
|
2180
|
+
|
2181
|
+
<li>
|
2182
|
+
|
2183
|
+
<span class='name'>processing_mode</span>
|
2184
|
+
|
2185
|
+
|
2186
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2187
|
+
|
2188
|
+
|
2189
|
+
<em class="default">(defaults to: <tt>'concurrent'</tt>)</em>
|
2190
|
+
|
2191
|
+
|
2192
|
+
—
|
2193
|
+
<div class='inline'>
|
2194
|
+
<p>The processing mode (concurrent/sequential)</p>
|
2195
|
+
</div>
|
2196
|
+
|
2197
|
+
</li>
|
2198
|
+
|
2199
|
+
<li>
|
2200
|
+
|
2201
|
+
<span class='name'>context</span>
|
2202
|
+
|
2203
|
+
|
2204
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2205
|
+
|
2206
|
+
|
2207
|
+
|
2208
|
+
—
|
2209
|
+
<div class='inline'>
|
2210
|
+
<p>Additional execution context</p>
|
2211
|
+
</div>
|
2212
|
+
|
2213
|
+
</li>
|
2214
|
+
|
2215
|
+
</ul>
|
2216
|
+
|
2217
|
+
|
2218
|
+
</div><table class="source_code">
|
2219
|
+
<tr>
|
2220
|
+
<td>
|
2221
|
+
<pre class="lines">
|
2222
|
+
|
2223
|
+
|
2224
|
+
459
|
2225
|
+
460
|
2226
|
+
461
|
2227
|
+
462
|
2228
|
+
463
|
2229
|
+
464
|
2230
|
+
465
|
2231
|
+
466
|
2232
|
+
467
|
2233
|
+
468
|
2234
|
+
469</pre>
|
2235
|
+
</td>
|
2236
|
+
<td>
|
2237
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 459</span>
|
2238
|
+
|
2239
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_steps_execution_started'>publish_steps_execution_started</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>step_count:</span><span class='comma'>,</span> <span class='label'>processing_mode:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>concurrent</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2240
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
2241
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
2242
|
+
<span class='label'>task_name:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
2243
|
+
<span class='label'>step_count:</span> <span class='id identifier rubyid_step_count'>step_count</span><span class='comma'>,</span>
|
2244
|
+
<span class='label'>processing_mode:</span> <span class='id identifier rubyid_processing_mode'>processing_mode</span>
|
2245
|
+
<span class='rparen'>)</span>
|
2246
|
+
|
2247
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:steps_execution_started</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2248
|
+
<span class='id identifier rubyid_publish_event'>publish_event</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#STEPS_EXECUTION_STARTED-constant" title="Tasker::Constants::WorkflowEvents::STEPS_EXECUTION_STARTED (constant)">STEPS_EXECUTION_STARTED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
|
2249
|
+
<span class='kw'>end</span></pre>
|
2250
|
+
</td>
|
2251
|
+
</tr>
|
2252
|
+
</table>
|
2253
|
+
</div>
|
2254
|
+
|
2255
|
+
<div class="method_details ">
|
2256
|
+
<h3 class="signature " id="publish_task_completed-instance_method">
|
2257
|
+
|
2258
|
+
#<strong>publish_task_completed</strong>(task, **context) ⇒ <tt>void</tt>
|
2259
|
+
|
2260
|
+
|
2261
|
+
|
2262
|
+
|
2263
|
+
|
2264
|
+
</h3><div class="docstring">
|
2265
|
+
<div class="discussion">
|
2266
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2267
|
+
<p>Publish task completed event Automatically resolves to TaskEvents::COMPLETED with :completed event type</p>
|
2268
|
+
|
2269
|
+
|
2270
|
+
</div>
|
2271
|
+
</div>
|
2272
|
+
<div class="tags">
|
2273
|
+
<p class="tag_title">Parameters:</p>
|
2274
|
+
<ul class="param">
|
2275
|
+
|
2276
|
+
<li>
|
2277
|
+
|
2278
|
+
<span class='name'>task</span>
|
2279
|
+
|
2280
|
+
|
2281
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
2282
|
+
|
2283
|
+
|
2284
|
+
|
2285
|
+
—
|
2286
|
+
<div class='inline'>
|
2287
|
+
<p>The task that completed</p>
|
2288
|
+
</div>
|
2289
|
+
|
2290
|
+
</li>
|
2291
|
+
|
2292
|
+
<li>
|
2293
|
+
|
2294
|
+
<span class='name'>context</span>
|
2295
|
+
|
2296
|
+
|
2297
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2298
|
+
|
2299
|
+
|
2300
|
+
|
2301
|
+
—
|
2302
|
+
<div class='inline'>
|
2303
|
+
<p>Additional context to merge into payload</p>
|
2304
|
+
</div>
|
2305
|
+
|
2306
|
+
</li>
|
2307
|
+
|
2308
|
+
</ul>
|
2309
|
+
|
2310
|
+
|
2311
|
+
</div><table class="source_code">
|
2312
|
+
<tr>
|
2313
|
+
<td>
|
2314
|
+
<pre class="lines">
|
2315
|
+
|
2316
|
+
|
2317
|
+
163
|
2318
|
+
164
|
2319
|
+
165
|
2320
|
+
166
|
2321
|
+
167
|
2322
|
+
168</pre>
|
2323
|
+
</td>
|
2324
|
+
<td>
|
2325
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 163</span>
|
2326
|
+
|
2327
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_completed'>publish_task_completed</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2328
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_task_payload'>build_task_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:completed</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2329
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/TaskEvents.html" title="Tasker::Constants::TaskEvents (module)">TaskEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/TaskEvents.html#COMPLETED-constant" title="Tasker::Constants::TaskEvents::COMPLETED (constant)">COMPLETED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
2330
|
+
<span class='id identifier rubyid_log_task_event'>log_task_event</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:completed</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:total_duration</span><span class='comma'>,</span> <span class='symbol'>:completed_steps</span><span class='comma'>,</span> <span class='symbol'>:total_steps</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
2331
|
+
<span class='kw'>end</span>
|
2332
|
+
<span class='kw'>end</span></pre>
|
2333
|
+
</td>
|
2334
|
+
</tr>
|
2335
|
+
</table>
|
2336
|
+
</div>
|
2337
|
+
|
2338
|
+
<div class="method_details ">
|
2339
|
+
<h3 class="signature " id="publish_task_enqueue-instance_method">
|
2340
|
+
|
2341
|
+
#<strong>publish_task_enqueue</strong>(task, **context) ⇒ <tt>void</tt>
|
2342
|
+
|
2343
|
+
|
2344
|
+
|
2345
|
+
|
2346
|
+
|
2347
|
+
</h3><div class="docstring">
|
2348
|
+
<div class="discussion">
|
2349
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2350
|
+
<p>Publish task enqueue event (for job scheduling observability) Automatically resolves to ObservabilityEvents::Task::ENQUEUE</p>
|
2351
|
+
|
2352
|
+
|
2353
|
+
</div>
|
2354
|
+
</div>
|
2355
|
+
<div class="tags">
|
2356
|
+
<p class="tag_title">Parameters:</p>
|
2357
|
+
<ul class="param">
|
2358
|
+
|
2359
|
+
<li>
|
2360
|
+
|
2361
|
+
<span class='name'>task</span>
|
2362
|
+
|
2363
|
+
|
2364
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
2365
|
+
|
2366
|
+
|
2367
|
+
|
2368
|
+
—
|
2369
|
+
<div class='inline'>
|
2370
|
+
<p>The task being enqueued</p>
|
2371
|
+
</div>
|
2372
|
+
|
2373
|
+
</li>
|
2374
|
+
|
2375
|
+
<li>
|
2376
|
+
|
2377
|
+
<span class='name'>context</span>
|
2378
|
+
|
2379
|
+
|
2380
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2381
|
+
|
2382
|
+
|
2383
|
+
|
2384
|
+
—
|
2385
|
+
<div class='inline'>
|
2386
|
+
<p>Additional enqueue context</p>
|
2387
|
+
</div>
|
2388
|
+
|
2389
|
+
</li>
|
2390
|
+
|
2391
|
+
</ul>
|
2392
|
+
|
2393
|
+
|
2394
|
+
</div><table class="source_code">
|
2395
|
+
<tr>
|
2396
|
+
<td>
|
2397
|
+
<pre class="lines">
|
2398
|
+
|
2399
|
+
|
2400
|
+
536
|
2401
|
+
537
|
2402
|
+
538
|
2403
|
+
539
|
2404
|
+
540
|
2405
|
+
541
|
2406
|
+
542
|
2407
|
+
543
|
2408
|
+
544
|
2409
|
+
545
|
2410
|
+
546
|
2411
|
+
547</pre>
|
2412
|
+
</td>
|
2413
|
+
<td>
|
2414
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 536</span>
|
2415
|
+
|
2416
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_enqueue'>publish_task_enqueue</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2417
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
2418
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
2419
|
+
<span class='label'>task_name:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
2420
|
+
<span class='label'>task_context:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_context'>context</span>
|
2421
|
+
<span class='rparen'>)</span>
|
2422
|
+
|
2423
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_task_payload'>build_task_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:enqueue</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2424
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/ObservabilityEvents.html" title="Tasker::Constants::ObservabilityEvents (module)">ObservabilityEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/ObservabilityEvents/Task.html" title="Tasker::Constants::ObservabilityEvents::Task (module)">Task</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/ObservabilityEvents/Task.html#ENQUEUE-constant" title="Tasker::Constants::ObservabilityEvents::Task::ENQUEUE (constant)">ENQUEUE</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
2425
|
+
<span class='id identifier rubyid_log_task_event'>log_task_event</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:enqueued</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:queue_name</span><span class='comma'>,</span> <span class='symbol'>:job_class</span><span class='comma'>,</span> <span class='symbol'>:priority</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
2426
|
+
<span class='kw'>end</span>
|
2427
|
+
<span class='kw'>end</span></pre>
|
2428
|
+
</td>
|
2429
|
+
</tr>
|
2430
|
+
</table>
|
2431
|
+
</div>
|
2432
|
+
|
2433
|
+
<div class="method_details ">
|
2434
|
+
<h3 class="signature " id="publish_task_failed-instance_method">
|
2435
|
+
|
2436
|
+
#<strong>publish_task_failed</strong>(task, error_message: 'Task execution failed', error_steps: [], **context) ⇒ <tt>void</tt>
|
2437
|
+
|
2438
|
+
|
2439
|
+
|
2440
|
+
|
2441
|
+
|
2442
|
+
</h3><div class="docstring">
|
2443
|
+
<div class="discussion">
|
2444
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2445
|
+
<p>Publish task failed event Automatically resolves to TaskEvents::FAILED with :failed event type</p>
|
2446
|
+
|
2447
|
+
|
2448
|
+
</div>
|
2449
|
+
</div>
|
2450
|
+
<div class="tags">
|
2451
|
+
<p class="tag_title">Parameters:</p>
|
2452
|
+
<ul class="param">
|
2453
|
+
|
2454
|
+
<li>
|
2455
|
+
|
2456
|
+
<span class='name'>task</span>
|
2457
|
+
|
2458
|
+
|
2459
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
2460
|
+
|
2461
|
+
|
2462
|
+
|
2463
|
+
—
|
2464
|
+
<div class='inline'>
|
2465
|
+
<p>The task that failed</p>
|
2466
|
+
</div>
|
2467
|
+
|
2468
|
+
</li>
|
2469
|
+
|
2470
|
+
<li>
|
2471
|
+
|
2472
|
+
<span class='name'>error_message</span>
|
2473
|
+
|
2474
|
+
|
2475
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2476
|
+
|
2477
|
+
|
2478
|
+
<em class="default">(defaults to: <tt>'Task execution failed'</tt>)</em>
|
2479
|
+
|
2480
|
+
|
2481
|
+
—
|
2482
|
+
<div class='inline'>
|
2483
|
+
<p>The error message</p>
|
2484
|
+
</div>
|
2485
|
+
|
2486
|
+
</li>
|
2487
|
+
|
2488
|
+
<li>
|
2489
|
+
|
2490
|
+
<span class='name'>error_steps</span>
|
2491
|
+
|
2492
|
+
|
2493
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
2494
|
+
|
2495
|
+
|
2496
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
2497
|
+
|
2498
|
+
|
2499
|
+
—
|
2500
|
+
<div class='inline'>
|
2501
|
+
<p>Array of failed step information</p>
|
2502
|
+
</div>
|
2503
|
+
|
2504
|
+
</li>
|
2505
|
+
|
2506
|
+
<li>
|
2507
|
+
|
2508
|
+
<span class='name'>context</span>
|
2509
|
+
|
2510
|
+
|
2511
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2512
|
+
|
2513
|
+
|
2514
|
+
|
2515
|
+
—
|
2516
|
+
<div class='inline'>
|
2517
|
+
<p>Additional context to merge into payload</p>
|
2518
|
+
</div>
|
2519
|
+
|
2520
|
+
</li>
|
2521
|
+
|
2522
|
+
</ul>
|
2523
|
+
|
2524
|
+
|
2525
|
+
</div><table class="source_code">
|
2526
|
+
<tr>
|
2527
|
+
<td>
|
2528
|
+
<pre class="lines">
|
2529
|
+
|
2530
|
+
|
2531
|
+
178
|
2532
|
+
179
|
2533
|
+
180
|
2534
|
+
181
|
2535
|
+
182
|
2536
|
+
183
|
2537
|
+
184
|
2538
|
+
185
|
2539
|
+
186
|
2540
|
+
187
|
2541
|
+
188
|
2542
|
+
189
|
2543
|
+
190
|
2544
|
+
191</pre>
|
2545
|
+
</td>
|
2546
|
+
<td>
|
2547
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 178</span>
|
2548
|
+
|
2549
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_failed'>publish_task_failed</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>error_message:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Task execution failed</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>error_steps:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2550
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
2551
|
+
<span class='label'>error_message:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='comma'>,</span>
|
2552
|
+
<span class='label'>error_steps:</span> <span class='id identifier rubyid_error_steps'>error_steps</span>
|
2553
|
+
<span class='rparen'>)</span>
|
2554
|
+
|
2555
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_task_payload'>build_task_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:failed</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2556
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/TaskEvents.html" title="Tasker::Constants::TaskEvents (module)">TaskEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/TaskEvents.html#FAILED-constant" title="Tasker::Constants::TaskEvents::FAILED (constant)">FAILED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
2557
|
+
<span class='id identifier rubyid_log_task_event'>log_task_event</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:failed</span><span class='comma'>,</span>
|
2558
|
+
<span class='label'>error:</span> <span class='id identifier rubyid_error_message'>error_message</span><span class='comma'>,</span>
|
2559
|
+
<span class='label'>failed_step_count:</span> <span class='id identifier rubyid_error_steps'>error_steps</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='comma'>,</span>
|
2560
|
+
<span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:total_duration</span><span class='comma'>,</span> <span class='symbol'>:completed_steps</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
2561
|
+
<span class='kw'>end</span>
|
2562
|
+
<span class='kw'>end</span></pre>
|
2563
|
+
</td>
|
2564
|
+
</tr>
|
2565
|
+
</table>
|
2566
|
+
</div>
|
2567
|
+
|
2568
|
+
<div class="method_details ">
|
2569
|
+
<h3 class="signature " id="publish_task_finalization_completed-instance_method">
|
2570
|
+
|
2571
|
+
#<strong>publish_task_finalization_completed</strong>(task, processed_steps_count: 0, **context) ⇒ <tt>void</tt>
|
2572
|
+
|
2573
|
+
|
2574
|
+
|
2575
|
+
|
2576
|
+
|
2577
|
+
</h3><div class="docstring">
|
2578
|
+
<div class="discussion">
|
2579
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2580
|
+
<p>Publish task finalization completed event</p>
|
2581
|
+
|
2582
|
+
|
2583
|
+
</div>
|
2584
|
+
</div>
|
2585
|
+
<div class="tags">
|
2586
|
+
<p class="tag_title">Parameters:</p>
|
2587
|
+
<ul class="param">
|
2588
|
+
|
2589
|
+
<li>
|
2590
|
+
|
2591
|
+
<span class='name'>task</span>
|
2592
|
+
|
2593
|
+
|
2594
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
2595
|
+
|
2596
|
+
|
2597
|
+
|
2598
|
+
—
|
2599
|
+
<div class='inline'>
|
2600
|
+
<p>The task that was finalized</p>
|
2601
|
+
</div>
|
2602
|
+
|
2603
|
+
</li>
|
2604
|
+
|
2605
|
+
<li>
|
2606
|
+
|
2607
|
+
<span class='name'>processed_steps_count</span>
|
2608
|
+
|
2609
|
+
|
2610
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2611
|
+
|
2612
|
+
|
2613
|
+
<em class="default">(defaults to: <tt>0</tt>)</em>
|
2614
|
+
|
2615
|
+
|
2616
|
+
—
|
2617
|
+
<div class='inline'>
|
2618
|
+
<p>Number of steps processed</p>
|
2619
|
+
</div>
|
2620
|
+
|
2621
|
+
</li>
|
2622
|
+
|
2623
|
+
<li>
|
2624
|
+
|
2625
|
+
<span class='name'>context</span>
|
2626
|
+
|
2627
|
+
|
2628
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2629
|
+
|
2630
|
+
|
2631
|
+
|
2632
|
+
—
|
2633
|
+
<div class='inline'>
|
2634
|
+
<p>Additional context</p>
|
2635
|
+
</div>
|
2636
|
+
|
2637
|
+
</li>
|
2638
|
+
|
2639
|
+
</ul>
|
2640
|
+
|
2641
|
+
|
2642
|
+
</div><table class="source_code">
|
2643
|
+
<tr>
|
2644
|
+
<td>
|
2645
|
+
<pre class="lines">
|
2646
|
+
|
2647
|
+
|
2648
|
+
309
|
2649
|
+
310
|
2650
|
+
311
|
2651
|
+
312
|
2652
|
+
313
|
2653
|
+
314
|
2654
|
+
315
|
2655
|
+
316
|
2656
|
+
317
|
2657
|
+
318
|
2658
|
+
319
|
2659
|
+
320
|
2660
|
+
321
|
2661
|
+
322
|
2662
|
+
323</pre>
|
2663
|
+
</td>
|
2664
|
+
<td>
|
2665
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 309</span>
|
2666
|
+
|
2667
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_finalization_completed'>publish_task_finalization_completed</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>processed_steps_count:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2668
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
2669
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
2670
|
+
<span class='label'>processed_steps_count:</span> <span class='id identifier rubyid_processed_steps_count'>processed_steps_count</span><span class='comma'>,</span>
|
2671
|
+
<span class='label'>final_status:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span>
|
2672
|
+
<span class='rparen'>)</span>
|
2673
|
+
|
2674
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:task_finalization_completed</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2675
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#TASK_FINALIZATION_COMPLETED-constant" title="Tasker::Constants::WorkflowEvents::TASK_FINALIZATION_COMPLETED (constant)">TASK_FINALIZATION_COMPLETED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
2676
|
+
<span class='id identifier rubyid_log_orchestration_event'>log_orchestration_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>task_finalization</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:completed</span><span class='comma'>,</span>
|
2677
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
2678
|
+
<span class='label'>final_status:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span><span class='comma'>,</span>
|
2679
|
+
<span class='label'>processed_steps_count:</span> <span class='id identifier rubyid_processed_steps_count'>processed_steps_count</span><span class='rparen'>)</span>
|
2680
|
+
<span class='kw'>end</span>
|
2681
|
+
<span class='kw'>end</span></pre>
|
2682
|
+
</td>
|
2683
|
+
</tr>
|
2684
|
+
</table>
|
2685
|
+
</div>
|
2686
|
+
|
2687
|
+
<div class="method_details ">
|
2688
|
+
<h3 class="signature " id="publish_task_finalization_started-instance_method">
|
2689
|
+
|
2690
|
+
#<strong>publish_task_finalization_started</strong>(task, processed_steps_count: 0, **context) ⇒ <tt>void</tt>
|
2691
|
+
|
2692
|
+
|
2693
|
+
|
2694
|
+
|
2695
|
+
|
2696
|
+
</h3><div class="docstring">
|
2697
|
+
<div class="discussion">
|
2698
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2699
|
+
<p>Publish task finalization started event</p>
|
2700
|
+
|
2701
|
+
|
2702
|
+
</div>
|
2703
|
+
</div>
|
2704
|
+
<div class="tags">
|
2705
|
+
<p class="tag_title">Parameters:</p>
|
2706
|
+
<ul class="param">
|
2707
|
+
|
2708
|
+
<li>
|
2709
|
+
|
2710
|
+
<span class='name'>task</span>
|
2711
|
+
|
2712
|
+
|
2713
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
2714
|
+
|
2715
|
+
|
2716
|
+
|
2717
|
+
—
|
2718
|
+
<div class='inline'>
|
2719
|
+
<p>The task being finalized</p>
|
2720
|
+
</div>
|
2721
|
+
|
2722
|
+
</li>
|
2723
|
+
|
2724
|
+
<li>
|
2725
|
+
|
2726
|
+
<span class='name'>processed_steps_count</span>
|
2727
|
+
|
2728
|
+
|
2729
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2730
|
+
|
2731
|
+
|
2732
|
+
<em class="default">(defaults to: <tt>0</tt>)</em>
|
2733
|
+
|
2734
|
+
|
2735
|
+
—
|
2736
|
+
<div class='inline'>
|
2737
|
+
<p>Number of steps processed</p>
|
2738
|
+
</div>
|
2739
|
+
|
2740
|
+
</li>
|
2741
|
+
|
2742
|
+
<li>
|
2743
|
+
|
2744
|
+
<span class='name'>context</span>
|
2745
|
+
|
2746
|
+
|
2747
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2748
|
+
|
2749
|
+
|
2750
|
+
|
2751
|
+
—
|
2752
|
+
<div class='inline'>
|
2753
|
+
<p>Additional context</p>
|
2754
|
+
</div>
|
2755
|
+
|
2756
|
+
</li>
|
2757
|
+
|
2758
|
+
</ul>
|
2759
|
+
|
2760
|
+
|
2761
|
+
</div><table class="source_code">
|
2762
|
+
<tr>
|
2763
|
+
<td>
|
2764
|
+
<pre class="lines">
|
2765
|
+
|
2766
|
+
|
2767
|
+
290
|
2768
|
+
291
|
2769
|
+
292
|
2770
|
+
293
|
2771
|
+
294
|
2772
|
+
295
|
2773
|
+
296
|
2774
|
+
297
|
2775
|
+
298
|
2776
|
+
299
|
2777
|
+
300
|
2778
|
+
301</pre>
|
2779
|
+
</td>
|
2780
|
+
<td>
|
2781
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 290</span>
|
2782
|
+
|
2783
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_finalization_started'>publish_task_finalization_started</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>processed_steps_count:</span> <span class='int'>0</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2784
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
2785
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
2786
|
+
<span class='label'>processed_steps_count:</span> <span class='id identifier rubyid_processed_steps_count'>processed_steps_count</span>
|
2787
|
+
<span class='rparen'>)</span>
|
2788
|
+
|
2789
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:task_finalization_started</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2790
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#TASK_FINALIZATION_STARTED-constant" title="Tasker::Constants::WorkflowEvents::TASK_FINALIZATION_STARTED (constant)">TASK_FINALIZATION_STARTED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
2791
|
+
<span class='id identifier rubyid_log_orchestration_event'>log_orchestration_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>task_finalization</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:started</span><span class='comma'>,</span>
|
2792
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='label'>processed_steps_count:</span> <span class='id identifier rubyid_processed_steps_count'>processed_steps_count</span><span class='rparen'>)</span>
|
2793
|
+
<span class='kw'>end</span>
|
2794
|
+
<span class='kw'>end</span></pre>
|
2795
|
+
</td>
|
2796
|
+
</tr>
|
2797
|
+
</table>
|
2798
|
+
</div>
|
2799
|
+
|
2800
|
+
<div class="method_details ">
|
2801
|
+
<h3 class="signature " id="publish_task_pending_transition-instance_method">
|
2802
|
+
|
2803
|
+
#<strong>publish_task_pending_transition</strong>(task, reason: 'Task set to pending', **context) ⇒ <tt>void</tt>
|
2804
|
+
|
2805
|
+
|
2806
|
+
|
2807
|
+
|
2808
|
+
|
2809
|
+
</h3><div class="docstring">
|
2810
|
+
<div class="discussion">
|
2811
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2812
|
+
<p>Publish task pending transition event (for synchronous processing) Automatically resolves to TaskEvents::INITIALIZE_REQUESTED with pending context</p>
|
2813
|
+
|
2814
|
+
|
2815
|
+
</div>
|
2816
|
+
</div>
|
2817
|
+
<div class="tags">
|
2818
|
+
<p class="tag_title">Parameters:</p>
|
2819
|
+
<ul class="param">
|
2820
|
+
|
2821
|
+
<li>
|
2822
|
+
|
2823
|
+
<span class='name'>task</span>
|
2824
|
+
|
2825
|
+
|
2826
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
2827
|
+
|
2828
|
+
|
2829
|
+
|
2830
|
+
—
|
2831
|
+
<div class='inline'>
|
2832
|
+
<p>The task being set to pending</p>
|
2833
|
+
</div>
|
2834
|
+
|
2835
|
+
</li>
|
2836
|
+
|
2837
|
+
<li>
|
2838
|
+
|
2839
|
+
<span class='name'>reason</span>
|
2840
|
+
|
2841
|
+
|
2842
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2843
|
+
|
2844
|
+
|
2845
|
+
<em class="default">(defaults to: <tt>'Task set to pending'</tt>)</em>
|
2846
|
+
|
2847
|
+
|
2848
|
+
—
|
2849
|
+
<div class='inline'>
|
2850
|
+
<p>The reason for setting to pending</p>
|
2851
|
+
</div>
|
2852
|
+
|
2853
|
+
</li>
|
2854
|
+
|
2855
|
+
<li>
|
2856
|
+
|
2857
|
+
<span class='name'>context</span>
|
2858
|
+
|
2859
|
+
|
2860
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2861
|
+
|
2862
|
+
|
2863
|
+
|
2864
|
+
—
|
2865
|
+
<div class='inline'>
|
2866
|
+
<p>Additional pending context</p>
|
2867
|
+
</div>
|
2868
|
+
|
2869
|
+
</li>
|
2870
|
+
|
2871
|
+
</ul>
|
2872
|
+
|
2873
|
+
|
2874
|
+
</div><table class="source_code">
|
2875
|
+
<tr>
|
2876
|
+
<td>
|
2877
|
+
<pre class="lines">
|
2878
|
+
|
2879
|
+
|
2880
|
+
332
|
2881
|
+
333
|
2882
|
+
334
|
2883
|
+
335
|
2884
|
+
336
|
2885
|
+
337
|
2886
|
+
338
|
2887
|
+
339
|
2888
|
+
340
|
2889
|
+
341</pre>
|
2890
|
+
</td>
|
2891
|
+
<td>
|
2892
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 332</span>
|
2893
|
+
|
2894
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_pending_transition'>publish_task_pending_transition</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>reason:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Task set to pending</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2895
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
2896
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
2897
|
+
<span class='label'>task_name:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
2898
|
+
<span class='label'>reason:</span> <span class='id identifier rubyid_reason'>reason</span>
|
2899
|
+
<span class='rparen'>)</span>
|
2900
|
+
|
2901
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_task_payload'>build_task_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:pending_transition</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
2902
|
+
<span class='id identifier rubyid_publish_event'>publish_event</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/TaskEvents.html" title="Tasker::Constants::TaskEvents (module)">TaskEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/TaskEvents.html#INITIALIZE_REQUESTED-constant" title="Tasker::Constants::TaskEvents::INITIALIZE_REQUESTED (constant)">INITIALIZE_REQUESTED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
|
2903
|
+
<span class='kw'>end</span></pre>
|
2904
|
+
</td>
|
2905
|
+
</tr>
|
2906
|
+
</table>
|
2907
|
+
</div>
|
2908
|
+
|
2909
|
+
<div class="method_details ">
|
2910
|
+
<h3 class="signature " id="publish_task_reenqueue_delayed-instance_method">
|
2911
|
+
|
2912
|
+
#<strong>publish_task_reenqueue_delayed</strong>(task, delay_seconds:, reason: 'Task reenqueue delayed', **context) ⇒ <tt>void</tt>
|
2913
|
+
|
2914
|
+
|
2915
|
+
|
2916
|
+
|
2917
|
+
|
2918
|
+
</h3><div class="docstring">
|
2919
|
+
<div class="discussion">
|
2920
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
2921
|
+
<p>Publish task reenqueue delayed event Automatically resolves to WorkflowEvents::TASK_REENQUEUE_DELAYED</p>
|
2922
|
+
|
2923
|
+
|
2924
|
+
</div>
|
2925
|
+
</div>
|
2926
|
+
<div class="tags">
|
2927
|
+
<p class="tag_title">Parameters:</p>
|
2928
|
+
<ul class="param">
|
2929
|
+
|
2930
|
+
<li>
|
2931
|
+
|
2932
|
+
<span class='name'>task</span>
|
2933
|
+
|
2934
|
+
|
2935
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
2936
|
+
|
2937
|
+
|
2938
|
+
|
2939
|
+
—
|
2940
|
+
<div class='inline'>
|
2941
|
+
<p>The task being delayed for reenqueue</p>
|
2942
|
+
</div>
|
2943
|
+
|
2944
|
+
</li>
|
2945
|
+
|
2946
|
+
<li>
|
2947
|
+
|
2948
|
+
<span class='name'>delay_seconds</span>
|
2949
|
+
|
2950
|
+
|
2951
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
2952
|
+
|
2953
|
+
|
2954
|
+
|
2955
|
+
—
|
2956
|
+
<div class='inline'>
|
2957
|
+
<p>Number of seconds to delay</p>
|
2958
|
+
</div>
|
2959
|
+
|
2960
|
+
</li>
|
2961
|
+
|
2962
|
+
<li>
|
2963
|
+
|
2964
|
+
<span class='name'>reason</span>
|
2965
|
+
|
2966
|
+
|
2967
|
+
<span class='type'>(<tt>String</tt>)</span>
|
2968
|
+
|
2969
|
+
|
2970
|
+
<em class="default">(defaults to: <tt>'Task reenqueue delayed'</tt>)</em>
|
2971
|
+
|
2972
|
+
|
2973
|
+
—
|
2974
|
+
<div class='inline'>
|
2975
|
+
<p>The reason for delayed reenqueue</p>
|
2976
|
+
</div>
|
2977
|
+
|
2978
|
+
</li>
|
2979
|
+
|
2980
|
+
<li>
|
2981
|
+
|
2982
|
+
<span class='name'>context</span>
|
2983
|
+
|
2984
|
+
|
2985
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
2986
|
+
|
2987
|
+
|
2988
|
+
|
2989
|
+
—
|
2990
|
+
<div class='inline'>
|
2991
|
+
<p>Additional reenqueue context</p>
|
2992
|
+
</div>
|
2993
|
+
|
2994
|
+
</li>
|
2995
|
+
|
2996
|
+
</ul>
|
2997
|
+
|
2998
|
+
|
2999
|
+
</div><table class="source_code">
|
3000
|
+
<tr>
|
3001
|
+
<td>
|
3002
|
+
<pre class="lines">
|
3003
|
+
|
3004
|
+
|
3005
|
+
433
|
3006
|
+
434
|
3007
|
+
435
|
3008
|
+
436
|
3009
|
+
437
|
3010
|
+
438
|
3011
|
+
439
|
3012
|
+
440
|
3013
|
+
441
|
3014
|
+
442
|
3015
|
+
443
|
3016
|
+
444
|
3017
|
+
445</pre>
|
3018
|
+
</td>
|
3019
|
+
<td>
|
3020
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 433</span>
|
3021
|
+
|
3022
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_reenqueue_delayed'>publish_task_reenqueue_delayed</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>delay_seconds:</span><span class='comma'>,</span> <span class='label'>reason:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Task reenqueue delayed</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3023
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
3024
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
3025
|
+
<span class='label'>task_name:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
3026
|
+
<span class='label'>reason:</span> <span class='id identifier rubyid_reason'>reason</span><span class='comma'>,</span>
|
3027
|
+
<span class='label'>delay_seconds:</span> <span class='id identifier rubyid_delay_seconds'>delay_seconds</span><span class='comma'>,</span>
|
3028
|
+
<span class='label'>scheduled_for:</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span> <span class='op'>+</span> <span class='id identifier rubyid_delay_seconds'>delay_seconds</span><span class='period'>.</span><span class='id identifier rubyid_seconds'>seconds</span><span class='comma'>,</span>
|
3029
|
+
<span class='label'>timestamp:</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span>
|
3030
|
+
<span class='rparen'>)</span>
|
3031
|
+
|
3032
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:task_reenqueue_delayed</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3033
|
+
<span class='id identifier rubyid_publish_event'>publish_event</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#TASK_REENQUEUE_DELAYED-constant" title="Tasker::Constants::WorkflowEvents::TASK_REENQUEUE_DELAYED (constant)">TASK_REENQUEUE_DELAYED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
|
3034
|
+
<span class='kw'>end</span></pre>
|
3035
|
+
</td>
|
3036
|
+
</tr>
|
3037
|
+
</table>
|
3038
|
+
</div>
|
3039
|
+
|
3040
|
+
<div class="method_details ">
|
3041
|
+
<h3 class="signature " id="publish_task_reenqueue_failed-instance_method">
|
3042
|
+
|
3043
|
+
#<strong>publish_task_reenqueue_failed</strong>(task, reason: 'Task reenqueue failed', error: 'Unknown error', **context) ⇒ <tt>void</tt>
|
3044
|
+
|
3045
|
+
|
3046
|
+
|
3047
|
+
|
3048
|
+
|
3049
|
+
</h3><div class="docstring">
|
3050
|
+
<div class="discussion">
|
3051
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
3052
|
+
<p>Publish task reenqueue failed event Automatically resolves to WorkflowEvents::TASK_REENQUEUE_FAILED</p>
|
3053
|
+
|
3054
|
+
|
3055
|
+
</div>
|
3056
|
+
</div>
|
3057
|
+
<div class="tags">
|
3058
|
+
<p class="tag_title">Parameters:</p>
|
3059
|
+
<ul class="param">
|
3060
|
+
|
3061
|
+
<li>
|
3062
|
+
|
3063
|
+
<span class='name'>task</span>
|
3064
|
+
|
3065
|
+
|
3066
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
3067
|
+
|
3068
|
+
|
3069
|
+
|
3070
|
+
—
|
3071
|
+
<div class='inline'>
|
3072
|
+
<p>The task that failed to reenqueue</p>
|
3073
|
+
</div>
|
3074
|
+
|
3075
|
+
</li>
|
3076
|
+
|
3077
|
+
<li>
|
3078
|
+
|
3079
|
+
<span class='name'>reason</span>
|
3080
|
+
|
3081
|
+
|
3082
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3083
|
+
|
3084
|
+
|
3085
|
+
<em class="default">(defaults to: <tt>'Task reenqueue failed'</tt>)</em>
|
3086
|
+
|
3087
|
+
|
3088
|
+
—
|
3089
|
+
<div class='inline'>
|
3090
|
+
<p>The reason for reenqueue attempt</p>
|
3091
|
+
</div>
|
3092
|
+
|
3093
|
+
</li>
|
3094
|
+
|
3095
|
+
<li>
|
3096
|
+
|
3097
|
+
<span class='name'>error</span>
|
3098
|
+
|
3099
|
+
|
3100
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3101
|
+
|
3102
|
+
|
3103
|
+
<em class="default">(defaults to: <tt>'Unknown error'</tt>)</em>
|
3104
|
+
|
3105
|
+
|
3106
|
+
—
|
3107
|
+
<div class='inline'>
|
3108
|
+
<p>The error message</p>
|
3109
|
+
</div>
|
3110
|
+
|
3111
|
+
</li>
|
3112
|
+
|
3113
|
+
<li>
|
3114
|
+
|
3115
|
+
<span class='name'>context</span>
|
3116
|
+
|
3117
|
+
|
3118
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
3119
|
+
|
3120
|
+
|
3121
|
+
|
3122
|
+
—
|
3123
|
+
<div class='inline'>
|
3124
|
+
<p>Additional reenqueue context</p>
|
3125
|
+
</div>
|
3126
|
+
|
3127
|
+
</li>
|
3128
|
+
|
3129
|
+
</ul>
|
3130
|
+
|
3131
|
+
|
3132
|
+
</div><table class="source_code">
|
3133
|
+
<tr>
|
3134
|
+
<td>
|
3135
|
+
<pre class="lines">
|
3136
|
+
|
3137
|
+
|
3138
|
+
412
|
3139
|
+
413
|
3140
|
+
414
|
3141
|
+
415
|
3142
|
+
416
|
3143
|
+
417
|
3144
|
+
418
|
3145
|
+
419
|
3146
|
+
420
|
3147
|
+
421
|
3148
|
+
422
|
3149
|
+
423</pre>
|
3150
|
+
</td>
|
3151
|
+
<td>
|
3152
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 412</span>
|
3153
|
+
|
3154
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_reenqueue_failed'>publish_task_reenqueue_failed</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>reason:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Task reenqueue failed</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>error:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Unknown error</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3155
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
3156
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
3157
|
+
<span class='label'>task_name:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
3158
|
+
<span class='label'>reason:</span> <span class='id identifier rubyid_reason'>reason</span><span class='comma'>,</span>
|
3159
|
+
<span class='label'>error:</span> <span class='id identifier rubyid_error'>error</span><span class='comma'>,</span>
|
3160
|
+
<span class='label'>timestamp:</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span>
|
3161
|
+
<span class='rparen'>)</span>
|
3162
|
+
|
3163
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:task_reenqueue_failed</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3164
|
+
<span class='id identifier rubyid_publish_event'>publish_event</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#TASK_REENQUEUE_FAILED-constant" title="Tasker::Constants::WorkflowEvents::TASK_REENQUEUE_FAILED (constant)">TASK_REENQUEUE_FAILED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
|
3165
|
+
<span class='kw'>end</span></pre>
|
3166
|
+
</td>
|
3167
|
+
</tr>
|
3168
|
+
</table>
|
3169
|
+
</div>
|
3170
|
+
|
3171
|
+
<div class="method_details ">
|
3172
|
+
<h3 class="signature " id="publish_task_reenqueue_requested-instance_method">
|
3173
|
+
|
3174
|
+
#<strong>publish_task_reenqueue_requested</strong>(task, reason: 'Task reenqueue requested', **context) ⇒ <tt>void</tt>
|
3175
|
+
|
3176
|
+
|
3177
|
+
|
3178
|
+
|
3179
|
+
|
3180
|
+
</h3><div class="docstring">
|
3181
|
+
<div class="discussion">
|
3182
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
3183
|
+
<p>Publish task reenqueue requested event Automatically resolves to WorkflowEvents::TASK_REENQUEUE_REQUESTED</p>
|
3184
|
+
|
3185
|
+
|
3186
|
+
</div>
|
3187
|
+
</div>
|
3188
|
+
<div class="tags">
|
3189
|
+
<p class="tag_title">Parameters:</p>
|
3190
|
+
<ul class="param">
|
3191
|
+
|
3192
|
+
<li>
|
3193
|
+
|
3194
|
+
<span class='name'>task</span>
|
3195
|
+
|
3196
|
+
|
3197
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
3198
|
+
|
3199
|
+
|
3200
|
+
|
3201
|
+
—
|
3202
|
+
<div class='inline'>
|
3203
|
+
<p>The task reenqueue was requested for</p>
|
3204
|
+
</div>
|
3205
|
+
|
3206
|
+
</li>
|
3207
|
+
|
3208
|
+
<li>
|
3209
|
+
|
3210
|
+
<span class='name'>reason</span>
|
3211
|
+
|
3212
|
+
|
3213
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3214
|
+
|
3215
|
+
|
3216
|
+
<em class="default">(defaults to: <tt>'Task reenqueue requested'</tt>)</em>
|
3217
|
+
|
3218
|
+
|
3219
|
+
—
|
3220
|
+
<div class='inline'>
|
3221
|
+
<p>The reason for reenqueue</p>
|
3222
|
+
</div>
|
3223
|
+
|
3224
|
+
</li>
|
3225
|
+
|
3226
|
+
<li>
|
3227
|
+
|
3228
|
+
<span class='name'>context</span>
|
3229
|
+
|
3230
|
+
|
3231
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
3232
|
+
|
3233
|
+
|
3234
|
+
|
3235
|
+
—
|
3236
|
+
<div class='inline'>
|
3237
|
+
<p>Additional reenqueue context</p>
|
3238
|
+
</div>
|
3239
|
+
|
3240
|
+
</li>
|
3241
|
+
|
3242
|
+
</ul>
|
3243
|
+
|
3244
|
+
|
3245
|
+
</div><table class="source_code">
|
3246
|
+
<tr>
|
3247
|
+
<td>
|
3248
|
+
<pre class="lines">
|
3249
|
+
|
3250
|
+
|
3251
|
+
392
|
3252
|
+
393
|
3253
|
+
394
|
3254
|
+
395
|
3255
|
+
396
|
3256
|
+
397
|
3257
|
+
398
|
3258
|
+
399
|
3259
|
+
400
|
3260
|
+
401
|
3261
|
+
402</pre>
|
3262
|
+
</td>
|
3263
|
+
<td>
|
3264
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 392</span>
|
3265
|
+
|
3266
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_reenqueue_requested'>publish_task_reenqueue_requested</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>reason:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Task reenqueue requested</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3267
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
3268
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
3269
|
+
<span class='label'>task_name:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
3270
|
+
<span class='label'>reason:</span> <span class='id identifier rubyid_reason'>reason</span><span class='comma'>,</span>
|
3271
|
+
<span class='label'>timestamp:</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span>
|
3272
|
+
<span class='rparen'>)</span>
|
3273
|
+
|
3274
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:task_reenqueue_requested</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3275
|
+
<span class='id identifier rubyid_publish_event'>publish_event</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#TASK_REENQUEUE_REQUESTED-constant" title="Tasker::Constants::WorkflowEvents::TASK_REENQUEUE_REQUESTED (constant)">TASK_REENQUEUE_REQUESTED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
|
3276
|
+
<span class='kw'>end</span></pre>
|
3277
|
+
</td>
|
3278
|
+
</tr>
|
3279
|
+
</table>
|
3280
|
+
</div>
|
3281
|
+
|
3282
|
+
<div class="method_details ">
|
3283
|
+
<h3 class="signature " id="publish_task_reenqueue_started-instance_method">
|
3284
|
+
|
3285
|
+
#<strong>publish_task_reenqueue_started</strong>(task, reason: 'Task reenqueue started', **context) ⇒ <tt>void</tt>
|
3286
|
+
|
3287
|
+
|
3288
|
+
|
3289
|
+
|
3290
|
+
|
3291
|
+
</h3><div class="docstring">
|
3292
|
+
<div class="discussion">
|
3293
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
3294
|
+
<p>Publish task reenqueue started event Automatically resolves to WorkflowEvents::TASK_REENQUEUE_STARTED</p>
|
3295
|
+
|
3296
|
+
|
3297
|
+
</div>
|
3298
|
+
</div>
|
3299
|
+
<div class="tags">
|
3300
|
+
<p class="tag_title">Parameters:</p>
|
3301
|
+
<ul class="param">
|
3302
|
+
|
3303
|
+
<li>
|
3304
|
+
|
3305
|
+
<span class='name'>task</span>
|
3306
|
+
|
3307
|
+
|
3308
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
3309
|
+
|
3310
|
+
|
3311
|
+
|
3312
|
+
—
|
3313
|
+
<div class='inline'>
|
3314
|
+
<p>The task being reenqueued</p>
|
3315
|
+
</div>
|
3316
|
+
|
3317
|
+
</li>
|
3318
|
+
|
3319
|
+
<li>
|
3320
|
+
|
3321
|
+
<span class='name'>reason</span>
|
3322
|
+
|
3323
|
+
|
3324
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3325
|
+
|
3326
|
+
|
3327
|
+
<em class="default">(defaults to: <tt>'Task reenqueue started'</tt>)</em>
|
3328
|
+
|
3329
|
+
|
3330
|
+
—
|
3331
|
+
<div class='inline'>
|
3332
|
+
<p>The reason for reenqueue</p>
|
3333
|
+
</div>
|
3334
|
+
|
3335
|
+
</li>
|
3336
|
+
|
3337
|
+
<li>
|
3338
|
+
|
3339
|
+
<span class='name'>context</span>
|
3340
|
+
|
3341
|
+
|
3342
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
3343
|
+
|
3344
|
+
|
3345
|
+
|
3346
|
+
—
|
3347
|
+
<div class='inline'>
|
3348
|
+
<p>Additional reenqueue context</p>
|
3349
|
+
</div>
|
3350
|
+
|
3351
|
+
</li>
|
3352
|
+
|
3353
|
+
</ul>
|
3354
|
+
|
3355
|
+
|
3356
|
+
</div><table class="source_code">
|
3357
|
+
<tr>
|
3358
|
+
<td>
|
3359
|
+
<pre class="lines">
|
3360
|
+
|
3361
|
+
|
3362
|
+
372
|
3363
|
+
373
|
3364
|
+
374
|
3365
|
+
375
|
3366
|
+
376
|
3367
|
+
377
|
3368
|
+
378
|
3369
|
+
379
|
3370
|
+
380
|
3371
|
+
381
|
3372
|
+
382
|
3373
|
+
383</pre>
|
3374
|
+
</td>
|
3375
|
+
<td>
|
3376
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 372</span>
|
3377
|
+
|
3378
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_reenqueue_started'>publish_task_reenqueue_started</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>reason:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Task reenqueue started</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3379
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
3380
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
3381
|
+
<span class='label'>task_name:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
3382
|
+
<span class='label'>reason:</span> <span class='id identifier rubyid_reason'>reason</span><span class='comma'>,</span>
|
3383
|
+
<span class='label'>current_status:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span><span class='comma'>,</span>
|
3384
|
+
<span class='label'>timestamp:</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span>
|
3385
|
+
<span class='rparen'>)</span>
|
3386
|
+
|
3387
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:task_reenqueue_started</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3388
|
+
<span class='id identifier rubyid_publish_event'>publish_event</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#TASK_REENQUEUE_STARTED-constant" title="Tasker::Constants::WorkflowEvents::TASK_REENQUEUE_STARTED (constant)">TASK_REENQUEUE_STARTED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
|
3389
|
+
<span class='kw'>end</span></pre>
|
3390
|
+
</td>
|
3391
|
+
</tr>
|
3392
|
+
</table>
|
3393
|
+
</div>
|
3394
|
+
|
3395
|
+
<div class="method_details ">
|
3396
|
+
<h3 class="signature " id="publish_task_retry_requested-instance_method">
|
3397
|
+
|
3398
|
+
#<strong>publish_task_retry_requested</strong>(task, retry_reason: 'Task retry requested', **context) ⇒ <tt>void</tt>
|
3399
|
+
|
3400
|
+
|
3401
|
+
|
3402
|
+
|
3403
|
+
|
3404
|
+
</h3><div class="docstring">
|
3405
|
+
<div class="discussion">
|
3406
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
3407
|
+
<p>Publish task retry requested event Automatically resolves to TaskEvents::RETRY_REQUESTED with :retry event type</p>
|
3408
|
+
|
3409
|
+
|
3410
|
+
</div>
|
3411
|
+
</div>
|
3412
|
+
<div class="tags">
|
3413
|
+
<p class="tag_title">Parameters:</p>
|
3414
|
+
<ul class="param">
|
3415
|
+
|
3416
|
+
<li>
|
3417
|
+
|
3418
|
+
<span class='name'>task</span>
|
3419
|
+
|
3420
|
+
|
3421
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
3422
|
+
|
3423
|
+
|
3424
|
+
|
3425
|
+
—
|
3426
|
+
<div class='inline'>
|
3427
|
+
<p>The task being retried</p>
|
3428
|
+
</div>
|
3429
|
+
|
3430
|
+
</li>
|
3431
|
+
|
3432
|
+
<li>
|
3433
|
+
|
3434
|
+
<span class='name'>retry_reason</span>
|
3435
|
+
|
3436
|
+
|
3437
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3438
|
+
|
3439
|
+
|
3440
|
+
<em class="default">(defaults to: <tt>'Task retry requested'</tt>)</em>
|
3441
|
+
|
3442
|
+
|
3443
|
+
—
|
3444
|
+
<div class='inline'>
|
3445
|
+
<p>The reason for the retry</p>
|
3446
|
+
</div>
|
3447
|
+
|
3448
|
+
</li>
|
3449
|
+
|
3450
|
+
<li>
|
3451
|
+
|
3452
|
+
<span class='name'>context</span>
|
3453
|
+
|
3454
|
+
|
3455
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
3456
|
+
|
3457
|
+
|
3458
|
+
|
3459
|
+
—
|
3460
|
+
<div class='inline'>
|
3461
|
+
<p>Additional context to merge into payload</p>
|
3462
|
+
</div>
|
3463
|
+
|
3464
|
+
</li>
|
3465
|
+
|
3466
|
+
</ul>
|
3467
|
+
|
3468
|
+
|
3469
|
+
</div><table class="source_code">
|
3470
|
+
<tr>
|
3471
|
+
<td>
|
3472
|
+
<pre class="lines">
|
3473
|
+
|
3474
|
+
|
3475
|
+
200
|
3476
|
+
201
|
3477
|
+
202
|
3478
|
+
203
|
3479
|
+
204
|
3480
|
+
205
|
3481
|
+
206</pre>
|
3482
|
+
</td>
|
3483
|
+
<td>
|
3484
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 200</span>
|
3485
|
+
|
3486
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_retry_requested'>publish_task_retry_requested</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>retry_reason:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Task retry requested</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3487
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>retry_reason:</span> <span class='id identifier rubyid_retry_reason'>retry_reason</span><span class='rparen'>)</span>
|
3488
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_task_payload'>build_task_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:retry</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3489
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/TaskEvents.html" title="Tasker::Constants::TaskEvents (module)">TaskEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/TaskEvents.html#RETRY_REQUESTED-constant" title="Tasker::Constants::TaskEvents::RETRY_REQUESTED (constant)">RETRY_REQUESTED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
3490
|
+
<span class='id identifier rubyid_log_task_event'>log_task_event</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:retry_requested</span><span class='comma'>,</span> <span class='label'>retry_reason:</span> <span class='id identifier rubyid_retry_reason'>retry_reason</span><span class='rparen'>)</span>
|
3491
|
+
<span class='kw'>end</span>
|
3492
|
+
<span class='kw'>end</span></pre>
|
3493
|
+
</td>
|
3494
|
+
</tr>
|
3495
|
+
</table>
|
3496
|
+
</div>
|
3497
|
+
|
3498
|
+
<div class="method_details ">
|
3499
|
+
<h3 class="signature " id="publish_task_started-instance_method">
|
3500
|
+
|
3501
|
+
#<strong>publish_task_started</strong>(task, **context) ⇒ <tt>void</tt>
|
3502
|
+
|
3503
|
+
|
3504
|
+
|
3505
|
+
|
3506
|
+
|
3507
|
+
</h3><div class="docstring">
|
3508
|
+
<div class="discussion">
|
3509
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
3510
|
+
<p>Publish task started event Automatically resolves to TaskEvents::START_REQUESTED with :started event type</p>
|
3511
|
+
|
3512
|
+
|
3513
|
+
</div>
|
3514
|
+
</div>
|
3515
|
+
<div class="tags">
|
3516
|
+
<p class="tag_title">Parameters:</p>
|
3517
|
+
<ul class="param">
|
3518
|
+
|
3519
|
+
<li>
|
3520
|
+
|
3521
|
+
<span class='name'>task</span>
|
3522
|
+
|
3523
|
+
|
3524
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
3525
|
+
|
3526
|
+
|
3527
|
+
|
3528
|
+
—
|
3529
|
+
<div class='inline'>
|
3530
|
+
<p>The task being started</p>
|
3531
|
+
</div>
|
3532
|
+
|
3533
|
+
</li>
|
3534
|
+
|
3535
|
+
<li>
|
3536
|
+
|
3537
|
+
<span class='name'>context</span>
|
3538
|
+
|
3539
|
+
|
3540
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
3541
|
+
|
3542
|
+
|
3543
|
+
|
3544
|
+
—
|
3545
|
+
<div class='inline'>
|
3546
|
+
<p>Additional context to merge into payload</p>
|
3547
|
+
</div>
|
3548
|
+
|
3549
|
+
</li>
|
3550
|
+
|
3551
|
+
</ul>
|
3552
|
+
|
3553
|
+
|
3554
|
+
</div><table class="source_code">
|
3555
|
+
<tr>
|
3556
|
+
<td>
|
3557
|
+
<pre class="lines">
|
3558
|
+
|
3559
|
+
|
3560
|
+
150
|
3561
|
+
151
|
3562
|
+
152
|
3563
|
+
153
|
3564
|
+
154
|
3565
|
+
155</pre>
|
3566
|
+
</td>
|
3567
|
+
<td>
|
3568
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 150</span>
|
3569
|
+
|
3570
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_task_started'>publish_task_started</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3571
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_task_payload'>build_task_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:started</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3572
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/TaskEvents.html" title="Tasker::Constants::TaskEvents (module)">TaskEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/TaskEvents.html#START_REQUESTED-constant" title="Tasker::Constants::TaskEvents::START_REQUESTED (constant)">START_REQUESTED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
3573
|
+
<span class='id identifier rubyid_log_task_event'>log_task_event</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:started</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:execution_mode</span><span class='comma'>,</span> <span class='symbol'>:priority</span><span class='comma'>,</span> <span class='symbol'>:step_count</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
3574
|
+
<span class='kw'>end</span>
|
3575
|
+
<span class='kw'>end</span></pre>
|
3576
|
+
</td>
|
3577
|
+
</tr>
|
3578
|
+
</table>
|
3579
|
+
</div>
|
3580
|
+
|
3581
|
+
<div class="method_details ">
|
3582
|
+
<h3 class="signature " id="publish_viable_steps_discovered-instance_method">
|
3583
|
+
|
3584
|
+
#<strong>publish_viable_steps_discovered</strong>(task_id, step_ids, processing_mode: 'concurrent', **context) ⇒ <tt>void</tt>
|
3585
|
+
|
3586
|
+
|
3587
|
+
|
3588
|
+
|
3589
|
+
|
3590
|
+
</h3><div class="docstring">
|
3591
|
+
<div class="discussion">
|
3592
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
3593
|
+
<p>Publish viable steps discovered event Automatically resolves to WorkflowEvents::VIABLE_STEPS_DISCOVERED</p>
|
3594
|
+
|
3595
|
+
|
3596
|
+
</div>
|
3597
|
+
</div>
|
3598
|
+
<div class="tags">
|
3599
|
+
<p class="tag_title">Parameters:</p>
|
3600
|
+
<ul class="param">
|
3601
|
+
|
3602
|
+
<li>
|
3603
|
+
|
3604
|
+
<span class='name'>task_id</span>
|
3605
|
+
|
3606
|
+
|
3607
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3608
|
+
|
3609
|
+
|
3610
|
+
|
3611
|
+
—
|
3612
|
+
<div class='inline'>
|
3613
|
+
<p>The task ID</p>
|
3614
|
+
</div>
|
3615
|
+
|
3616
|
+
</li>
|
3617
|
+
|
3618
|
+
<li>
|
3619
|
+
|
3620
|
+
<span class='name'>step_ids</span>
|
3621
|
+
|
3622
|
+
|
3623
|
+
<span class='type'>(<tt>Array<String></tt>)</span>
|
3624
|
+
|
3625
|
+
|
3626
|
+
|
3627
|
+
—
|
3628
|
+
<div class='inline'>
|
3629
|
+
<p>Array of step IDs that are viable</p>
|
3630
|
+
</div>
|
3631
|
+
|
3632
|
+
</li>
|
3633
|
+
|
3634
|
+
<li>
|
3635
|
+
|
3636
|
+
<span class='name'>processing_mode</span>
|
3637
|
+
|
3638
|
+
|
3639
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3640
|
+
|
3641
|
+
|
3642
|
+
<em class="default">(defaults to: <tt>'concurrent'</tt>)</em>
|
3643
|
+
|
3644
|
+
|
3645
|
+
—
|
3646
|
+
<div class='inline'>
|
3647
|
+
<p>The processing mode (‘concurrent’ or ‘sequential’)</p>
|
3648
|
+
</div>
|
3649
|
+
|
3650
|
+
</li>
|
3651
|
+
|
3652
|
+
<li>
|
3653
|
+
|
3654
|
+
<span class='name'>context</span>
|
3655
|
+
|
3656
|
+
|
3657
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
3658
|
+
|
3659
|
+
|
3660
|
+
|
3661
|
+
—
|
3662
|
+
<div class='inline'>
|
3663
|
+
<p>Additional orchestration context</p>
|
3664
|
+
</div>
|
3665
|
+
|
3666
|
+
</li>
|
3667
|
+
|
3668
|
+
</ul>
|
3669
|
+
|
3670
|
+
|
3671
|
+
</div><table class="source_code">
|
3672
|
+
<tr>
|
3673
|
+
<td>
|
3674
|
+
<pre class="lines">
|
3675
|
+
|
3676
|
+
|
3677
|
+
250
|
3678
|
+
251
|
3679
|
+
252
|
3680
|
+
253
|
3681
|
+
254
|
3682
|
+
255
|
3683
|
+
256
|
3684
|
+
257
|
3685
|
+
258
|
3686
|
+
259
|
3687
|
+
260
|
3688
|
+
261
|
3689
|
+
262
|
3690
|
+
263</pre>
|
3691
|
+
</td>
|
3692
|
+
<td>
|
3693
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 250</span>
|
3694
|
+
|
3695
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_viable_steps_discovered'>publish_viable_steps_discovered</span><span class='lparen'>(</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='id identifier rubyid_step_ids'>step_ids</span><span class='comma'>,</span> <span class='label'>processing_mode:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>concurrent</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3696
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
3697
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
3698
|
+
<span class='label'>step_ids:</span> <span class='id identifier rubyid_step_ids'>step_ids</span><span class='comma'>,</span>
|
3699
|
+
<span class='label'>processing_mode:</span> <span class='id identifier rubyid_processing_mode'>processing_mode</span><span class='comma'>,</span>
|
3700
|
+
<span class='label'>step_count:</span> <span class='id identifier rubyid_step_ids'>step_ids</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
|
3701
|
+
<span class='rparen'>)</span>
|
3702
|
+
|
3703
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:viable_steps_discovered</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3704
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#VIABLE_STEPS_DISCOVERED-constant" title="Tasker::Constants::WorkflowEvents::VIABLE_STEPS_DISCOVERED (constant)">VIABLE_STEPS_DISCOVERED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
3705
|
+
<span class='id identifier rubyid_log_orchestration_event'>log_orchestration_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>viable_steps_discovered</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:discovered</span><span class='comma'>,</span>
|
3706
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='label'>step_count:</span> <span class='id identifier rubyid_step_ids'>step_ids</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='comma'>,</span> <span class='label'>processing_mode:</span> <span class='id identifier rubyid_processing_mode'>processing_mode</span><span class='rparen'>)</span>
|
3707
|
+
<span class='kw'>end</span>
|
3708
|
+
<span class='kw'>end</span></pre>
|
3709
|
+
</td>
|
3710
|
+
</tr>
|
3711
|
+
</table>
|
3712
|
+
</div>
|
3713
|
+
|
3714
|
+
<div class="method_details ">
|
3715
|
+
<h3 class="signature " id="publish_workflow_state_unclear-instance_method">
|
3716
|
+
|
3717
|
+
#<strong>publish_workflow_state_unclear</strong>(task, reason: 'Task in unclear state', **context) ⇒ <tt>void</tt>
|
3718
|
+
|
3719
|
+
|
3720
|
+
|
3721
|
+
|
3722
|
+
|
3723
|
+
</h3><div class="docstring">
|
3724
|
+
<div class="discussion">
|
3725
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
3726
|
+
<p>Publish workflow unclear state event (for monitoring/alerting) Automatically resolves to WorkflowEvents::TASK_STATE_UNCLEAR</p>
|
3727
|
+
|
3728
|
+
|
3729
|
+
</div>
|
3730
|
+
</div>
|
3731
|
+
<div class="tags">
|
3732
|
+
<p class="tag_title">Parameters:</p>
|
3733
|
+
<ul class="param">
|
3734
|
+
|
3735
|
+
<li>
|
3736
|
+
|
3737
|
+
<span class='name'>task</span>
|
3738
|
+
|
3739
|
+
|
3740
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Task</a></span></tt>)</span>
|
3741
|
+
|
3742
|
+
|
3743
|
+
|
3744
|
+
—
|
3745
|
+
<div class='inline'>
|
3746
|
+
<p>The task in unclear state</p>
|
3747
|
+
</div>
|
3748
|
+
|
3749
|
+
</li>
|
3750
|
+
|
3751
|
+
<li>
|
3752
|
+
|
3753
|
+
<span class='name'>reason</span>
|
3754
|
+
|
3755
|
+
|
3756
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3757
|
+
|
3758
|
+
|
3759
|
+
<em class="default">(defaults to: <tt>'Task in unclear state'</tt>)</em>
|
3760
|
+
|
3761
|
+
|
3762
|
+
—
|
3763
|
+
<div class='inline'>
|
3764
|
+
<p>The reason the state is unclear</p>
|
3765
|
+
</div>
|
3766
|
+
|
3767
|
+
</li>
|
3768
|
+
|
3769
|
+
<li>
|
3770
|
+
|
3771
|
+
<span class='name'>context</span>
|
3772
|
+
|
3773
|
+
|
3774
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
3775
|
+
|
3776
|
+
|
3777
|
+
|
3778
|
+
—
|
3779
|
+
<div class='inline'>
|
3780
|
+
<p>Additional unclear state context</p>
|
3781
|
+
</div>
|
3782
|
+
|
3783
|
+
</li>
|
3784
|
+
|
3785
|
+
</ul>
|
3786
|
+
|
3787
|
+
|
3788
|
+
</div><table class="source_code">
|
3789
|
+
<tr>
|
3790
|
+
<td>
|
3791
|
+
<pre class="lines">
|
3792
|
+
|
3793
|
+
|
3794
|
+
350
|
3795
|
+
351
|
3796
|
+
352
|
3797
|
+
353
|
3798
|
+
354
|
3799
|
+
355
|
3800
|
+
356
|
3801
|
+
357
|
3802
|
+
358
|
3803
|
+
359</pre>
|
3804
|
+
</td>
|
3805
|
+
<td>
|
3806
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 350</span>
|
3807
|
+
|
3808
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_workflow_state_unclear'>publish_workflow_state_unclear</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='label'>reason:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Task in unclear state</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3809
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span>
|
3810
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
|
3811
|
+
<span class='label'>task_name:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
3812
|
+
<span class='label'>reason:</span> <span class='id identifier rubyid_reason'>reason</span>
|
3813
|
+
<span class='rparen'>)</span>
|
3814
|
+
|
3815
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:task_state_unclear</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3816
|
+
<span class='id identifier rubyid_publish_event'>publish_event</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#TASK_STATE_UNCLEAR-constant" title="Tasker::Constants::WorkflowEvents::TASK_STATE_UNCLEAR (constant)">TASK_STATE_UNCLEAR</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span>
|
3817
|
+
<span class='kw'>end</span></pre>
|
3818
|
+
</td>
|
3819
|
+
</tr>
|
3820
|
+
</table>
|
3821
|
+
</div>
|
3822
|
+
|
3823
|
+
<div class="method_details ">
|
3824
|
+
<h3 class="signature " id="publish_workflow_step_completed-instance_method">
|
3825
|
+
|
3826
|
+
#<strong>publish_workflow_step_completed</strong>(task_id, step_id, **context) ⇒ <tt>void</tt>
|
3827
|
+
|
3828
|
+
|
3829
|
+
|
3830
|
+
|
3831
|
+
|
3832
|
+
</h3><div class="docstring">
|
3833
|
+
<div class="discussion">
|
3834
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
3835
|
+
<p>Publish workflow step completed event (orchestration layer) Automatically resolves to WorkflowEvents::STEP_COMPLETED</p>
|
3836
|
+
|
3837
|
+
|
3838
|
+
</div>
|
3839
|
+
</div>
|
3840
|
+
<div class="tags">
|
3841
|
+
<p class="tag_title">Parameters:</p>
|
3842
|
+
<ul class="param">
|
3843
|
+
|
3844
|
+
<li>
|
3845
|
+
|
3846
|
+
<span class='name'>task_id</span>
|
3847
|
+
|
3848
|
+
|
3849
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3850
|
+
|
3851
|
+
|
3852
|
+
|
3853
|
+
—
|
3854
|
+
<div class='inline'>
|
3855
|
+
<p>The task ID</p>
|
3856
|
+
</div>
|
3857
|
+
|
3858
|
+
</li>
|
3859
|
+
|
3860
|
+
<li>
|
3861
|
+
|
3862
|
+
<span class='name'>step_id</span>
|
3863
|
+
|
3864
|
+
|
3865
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3866
|
+
|
3867
|
+
|
3868
|
+
|
3869
|
+
—
|
3870
|
+
<div class='inline'>
|
3871
|
+
<p>The step ID</p>
|
3872
|
+
</div>
|
3873
|
+
|
3874
|
+
</li>
|
3875
|
+
|
3876
|
+
<li>
|
3877
|
+
|
3878
|
+
<span class='name'>context</span>
|
3879
|
+
|
3880
|
+
|
3881
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
3882
|
+
|
3883
|
+
|
3884
|
+
|
3885
|
+
—
|
3886
|
+
<div class='inline'>
|
3887
|
+
<p>Additional orchestration context</p>
|
3888
|
+
</div>
|
3889
|
+
|
3890
|
+
</li>
|
3891
|
+
|
3892
|
+
</ul>
|
3893
|
+
|
3894
|
+
|
3895
|
+
</div><table class="source_code">
|
3896
|
+
<tr>
|
3897
|
+
<td>
|
3898
|
+
<pre class="lines">
|
3899
|
+
|
3900
|
+
|
3901
|
+
233
|
3902
|
+
234
|
3903
|
+
235
|
3904
|
+
236
|
3905
|
+
237
|
3906
|
+
238
|
3907
|
+
239
|
3908
|
+
240</pre>
|
3909
|
+
</td>
|
3910
|
+
<td>
|
3911
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 233</span>
|
3912
|
+
|
3913
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_workflow_step_completed'>publish_workflow_step_completed</span><span class='lparen'>(</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='id identifier rubyid_step_id'>step_id</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3914
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>task_id:</span> <span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='label'>step_id:</span> <span class='id identifier rubyid_step_id'>step_id</span><span class='rparen'>)</span>
|
3915
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:step_completed</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3916
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#STEP_COMPLETED-constant" title="Tasker::Constants::WorkflowEvents::STEP_COMPLETED (constant)">STEP_COMPLETED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
3917
|
+
<span class='id identifier rubyid_log_orchestration_event'>log_orchestration_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>workflow_step_completed</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:completed</span><span class='comma'>,</span>
|
3918
|
+
<span class='label'>task_id:</span> <span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='label'>step_id:</span> <span class='id identifier rubyid_step_id'>step_id</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
3919
|
+
<span class='kw'>end</span>
|
3920
|
+
<span class='kw'>end</span></pre>
|
3921
|
+
</td>
|
3922
|
+
</tr>
|
3923
|
+
</table>
|
3924
|
+
</div>
|
3925
|
+
|
3926
|
+
<div class="method_details ">
|
3927
|
+
<h3 class="signature " id="publish_workflow_task_started-instance_method">
|
3928
|
+
|
3929
|
+
#<strong>publish_workflow_task_started</strong>(task_id, **context) ⇒ <tt>void</tt>
|
3930
|
+
|
3931
|
+
|
3932
|
+
|
3933
|
+
|
3934
|
+
|
3935
|
+
</h3><div class="docstring">
|
3936
|
+
<div class="discussion">
|
3937
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
3938
|
+
<p>Publish workflow task started event (orchestration layer) Automatically resolves to WorkflowEvents::TASK_STARTED</p>
|
3939
|
+
|
3940
|
+
|
3941
|
+
</div>
|
3942
|
+
</div>
|
3943
|
+
<div class="tags">
|
3944
|
+
<p class="tag_title">Parameters:</p>
|
3945
|
+
<ul class="param">
|
3946
|
+
|
3947
|
+
<li>
|
3948
|
+
|
3949
|
+
<span class='name'>task_id</span>
|
3950
|
+
|
3951
|
+
|
3952
|
+
<span class='type'>(<tt>String</tt>)</span>
|
3953
|
+
|
3954
|
+
|
3955
|
+
|
3956
|
+
—
|
3957
|
+
<div class='inline'>
|
3958
|
+
<p>The task ID</p>
|
3959
|
+
</div>
|
3960
|
+
|
3961
|
+
</li>
|
3962
|
+
|
3963
|
+
<li>
|
3964
|
+
|
3965
|
+
<span class='name'>context</span>
|
3966
|
+
|
3967
|
+
|
3968
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
3969
|
+
|
3970
|
+
|
3971
|
+
|
3972
|
+
—
|
3973
|
+
<div class='inline'>
|
3974
|
+
<p>Additional orchestration context</p>
|
3975
|
+
</div>
|
3976
|
+
|
3977
|
+
</li>
|
3978
|
+
|
3979
|
+
</ul>
|
3980
|
+
|
3981
|
+
|
3982
|
+
</div><table class="source_code">
|
3983
|
+
<tr>
|
3984
|
+
<td>
|
3985
|
+
<pre class="lines">
|
3986
|
+
|
3987
|
+
|
3988
|
+
218
|
3989
|
+
219
|
3990
|
+
220
|
3991
|
+
221
|
3992
|
+
222
|
3993
|
+
223
|
3994
|
+
224</pre>
|
3995
|
+
</td>
|
3996
|
+
<td>
|
3997
|
+
<pre class="code"><span class="info file"># File 'lib/tasker/concerns/event_publisher.rb', line 218</span>
|
3998
|
+
|
3999
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_publish_workflow_task_started'>publish_workflow_task_started</span><span class='lparen'>(</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
4000
|
+
<span class='id identifier rubyid_context'>context</span> <span class='op'>=</span> <span class='id identifier rubyid_context'>context</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>task_id:</span> <span class='id identifier rubyid_task_id'>task_id</span><span class='rparen'>)</span>
|
4001
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_build_orchestration_payload'>build_orchestration_payload</span><span class='lparen'>(</span><span class='symbol'>:task_started</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
4002
|
+
<span class='id identifier rubyid_publish_event_with_logging'>publish_event_with_logging</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants.html" title="Tasker::Constants (module)">Constants</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html" title="Tasker::Constants::WorkflowEvents (module)">WorkflowEvents</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Constants/WorkflowEvents.html#TASK_STARTED-constant" title="Tasker::Constants::WorkflowEvents::TASK_STARTED (constant)">TASK_STARTED</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='rparen'>)</span> <span class='kw'>do</span>
|
4003
|
+
<span class='id identifier rubyid_log_orchestration_event'>log_orchestration_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>workflow_task_started</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:started</span><span class='comma'>,</span> <span class='label'>task_id:</span> <span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
|
4004
|
+
<span class='kw'>end</span>
|
4005
|
+
<span class='kw'>end</span></pre>
|
4006
|
+
</td>
|
4007
|
+
</tr>
|
4008
|
+
</table>
|
4009
|
+
</div>
|
4010
|
+
|
4011
|
+
</div>
|
4012
|
+
|
4013
|
+
</div>
|
4014
|
+
|
4015
|
+
<div id="footer">
|
4016
|
+
Generated on Tue Jul 1 16:47:35 2025 by
|
4017
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
4018
|
+
0.9.37 (ruby-3.2.4).
|
4019
|
+
</div>
|
4020
|
+
|
4021
|
+
</div>
|
4022
|
+
</body>
|
4023
|
+
</html>
|