interrupt

package
v0.0.0-...-0f879ca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

Interrupt

This is a simple example of a workflow that uses an ExternalEvent to trigger an Interrupt Handler.

Start the Task Worker

We have two TaskDef's and thus two Task Functions. Note that worker/main.go kicks off two threads, one for each Task Worker.

go run ./interrupt/worker

Register the WfSpec

In another terminal, run:

go run ./interrupt/deploy

Run a WfRun

Let's run the WfRun:

lhctl run interrupt-example

Note the wfRunId. The WfRun will be sleeping for 15 seconds, in which time you can add to the tally by sending an interrupt event to it:

lhctl postEvent <wfRunId> update-tally INT 10

Then you can see all of the ThreadRuns in the WfRun by:

lhctl get wfRun <wfRunId>

And you can see the final tally via:

lhctl get variable <wfRunId> 0 tally

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChildFooTask

func ChildFooTask(interruptInput int) string

func InterruptWorkflow

func InterruptWorkflow(thread *wflib.ThreadBuilder)

func ReportTheResult

func ReportTheResult(input int) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL