cron

package
v0.0.0-...-94a9b73 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

This sample demonstrates how to setup cron based workflow.

Steps to run this sample:

  1. You need a Temporal service running. See README.md for more details.
  2. Run
go run cron/worker/main.go 

to start worker for cron workflow. 3) Run

go run cron/starter/main.go

to start workflow with cron expression scheduled to run every minute.

Documentation

Overview

@@@SNIPSTART samples-go-cron-workflow

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoSomething

func DoSomething(ctx context.Context, lastRunTime, thisRunTime time.Time) error

DoSomething is an Activity

Types

type CronResult

type CronResult struct {
	RunTime time.Time
}

CronResult is used to return data from one cron run to the next

func SampleCronWorkflow

func SampleCronWorkflow(ctx workflow.Context) (*CronResult, error)

SampleCronWorkflow executes on the given schedule The schedule is provided when starting the Workflow

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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