wfs

package
v0.8.17 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MoreActivities added in v0.8.15

type MoreActivities func(activityWorker worker.Worker) error

MoreActivities is a function callback type to add more activities and custom worflows to the framework's single worker

type Server

type Server struct {
	TemporalClient client.Client      // Client is attached to a temporal.io server
	Cache          *cache.Cache       // Cache holds workflow definitions loaded from disk
	Watcher        *watcher.Watcher   // Watcher is used to watch the file system for *.fse changes
	Tracer         opentracing.Tracer // Tracer is used to trace spans to
	Add            MoreActivities     // Add is used to inject custom activities implemented by client code. If nil this callback method is not called.
	// contains filtered or unexported fields
}

Server operates a workflow registry and a bunch of *.fse workflows stored and watched on disk

func (Server) AddHandlers

func (s Server) AddHandlers(mux *http.ServeMux) http.Handler

AddHandlers adds all of this Server's http handlers to mux, attaches open tracing middleware to mux and returns this handler

func (Server) Close

func (s Server) Close() error

Close closes all services of the Server

func (Server) Create

func (s Server) Create(w http.ResponseWriter, r *http.Request)

Create is the HandlerFunc for the /create operation

func (Server) Definition

func (s Server) Definition(w http.ResponseWriter, r *http.Request)

Definition is the HandlerFunc for /. It provides a simple UI for listing and showing workflow definitions hosted an this Server.

func (Server) History added in v0.8.14

func (s Server) History(w http.ResponseWriter, r *http.Request)

History implements the /history operation

func (Server) Inspect

func (s Server) Inspect(w http.ResponseWriter, r *http.Request)

Inspect is the HandlerFunc for the /inspect operation

func (Server) InspectSchema added in v0.7.13

func (s Server) InspectSchema(w http.ResponseWriter, r *http.Request)

InspectSchema is the HandlerFunc for the /inspectschema operation

func (Server) List

func (s Server) List(w http.ResponseWriter, r *http.Request)

List is the HandlerFunc for the /list operation

func (Server) Schema added in v0.5.6

func (s Server) Schema(w http.ResponseWriter, r *http.Request)

Schema is the HandlerFunc for the /schema operation

func (Server) Signal

func (s Server) Signal(w http.ResponseWriter, r *http.Request)

Signal is the HandlerFunc for the /signal operation

func (Server) Terminate

func (s Server) Terminate(w http.ResponseWriter, r *http.Request)

Terminate is the HandlerFunc for the /terminate operation

type ServerOptions

type ServerOptions struct {
	WorkflowsGlobPattern     string        // WorkflowsGlobPattern ist the glob pattern for *.fse files this Server loads and hosts
	WatcherDebounce          time.Duration // WatcherDebounce is the debounce time for a file system watcher if positive. Else no watcher is attached.
	ResetRegistry            bool          // ResetRegistry sholod be set to true, if the registry workflow needs to be restarted
	TaskqueueName            string        // TaskqueueName is the name of the temporal task queue this host listens on, it's the same for FSE workflows, the registry wf and for actions
	OpenTracingServicename   string        // OpenTracingServicename is the name this server publishes its spans under
	workflow.ActivityOptions               // ActivityOptions besides TaskQueue=ActionqueueName() are passed to all activities started by the ActivityDispatcher
}

ServerOptions contains the fields to configure the workflow server

func (ServerOptions) InitializeServer

func (so ServerOptions) InitializeServer(cli client.Client, add MoreActivities) (Server, error)

InitializeServer initializes a new Server based on the ServerOptions. add can be nil. If not it is called when the framework decides to start a new temporal worker b/c the FSE definitions need to be replaced. It should be used to add custom activities and probably custom workflows to the worker.

Jump to

Keyboard shortcuts

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