Documentation ¶
Index ¶
- func CadenceWorkerActor(worker CadenceWorker) (execute func() error, interrupt func(error))
- func CadenceWorkerRun(worker CadenceWorker) (execute func() error, interrupt func(error))deprecated
- func GRPCServe(server GRPCServer, lis net.Listener) (execute func() error, interrupt func(error))
- func GracefulRestart(ctx context.Context, upg Upgrader) (execute func() error, interrupt func(error))
- func HTTPServe(server HTTPServer, lis net.Listener, shutdownTimeout time.Duration) (execute func() error, interrupt func(error))
- func TemporalWorkerActor(worker TemporalWorker) (execute func() error, interrupt func(error))
- type CadenceWorker
- type GRPCServer
- type HTTPServer
- type ServeLogger
- type TemporalWorker
- type Upgrader
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CadenceWorkerActor ¶ added in v0.9.0
func CadenceWorkerActor(worker CadenceWorker) (execute func() error, interrupt func(error))
CadenceWorkerActor returns an actor, i.e. an execute and interrupt func, that terminates when the underlying worker fails or stops running.
Although the Cadence Worker component has a blocking Run function, internally it waits for a SIGTERM signal which does not fit perfectly into run group.
func CadenceWorkerRun
deprecated
added in
v0.8.0
func CadenceWorkerRun(worker CadenceWorker) (execute func() error, interrupt func(error))
Deprecated: use CadenceWorkerActor instead.
func GRPCServe ¶
func GRPCServe(server GRPCServer, lis net.Listener) (execute func() error, interrupt func(error))
GRPCServe returns an actor, i.e. an execute and interrupt func, that terminates when the underlying gRPC server fails.
func GracefulRestart ¶
func GracefulRestart(ctx context.Context, upg Upgrader) (execute func() error, interrupt func(error))
GracefulRestart returns an actor, i.e. an execute and interrupt func, that terminates when graceful restart is initiated and the child process signals to be ready, or the parent context is canceled.
func HTTPServe ¶ added in v0.5.0
func HTTPServe( server HTTPServer, lis net.Listener, shutdownTimeout time.Duration, ) (execute func() error, interrupt func(error))
HTTPServe returns an actor, i.e. an execute and interrupt func, that terminates when the underlying HTTP server fails.
It accepts a timeout parameter for the graceful shutdown. 0 means no timeout.
func TemporalWorkerActor ¶ added in v0.9.0
func TemporalWorkerActor(worker TemporalWorker) (execute func() error, interrupt func(error))
TemporalWorkerActor returns an actor, i.e. an execute and interrupt func, that terminates when the underlying worker fails or stops running.
Although the Temporal Worker component has a blocking Run function, internally it waits for a SIGTERM signal which does not fit perfectly into run group.
Types ¶
type CadenceWorker ¶ added in v0.8.0
type CadenceWorker interface { // Start starts the worker in a non-blocking fashion. Start() error // Stop cleans up any resources opened by worker. Stop() }
CadenceWorker is an Uber Cadence worker instance.
type GRPCServer ¶
GRPCServer is a gRPC server.
type HTTPServer ¶ added in v0.5.0
HTTPServer is an HTTP server.
type ServeLogger ¶ added in v0.5.0
type ServeLogger interface { // Info logs an Info event. Info(msg string, fields ...map[string]interface{}) }
ServeLogger logs server start/shutdown events.
type TemporalWorker ¶ added in v0.9.0
type TemporalWorker interface { // Start starts the worker in a non-blocking fashion. Start() error // Stop cleans up any resources opened by worker. Stop() }
TemporalWorker is a Temporal worker instance.
type Upgrader ¶
type Upgrader interface { Ready() error Exit() <-chan struct{} Stop() }
Upgrader handles zero downtime upgrades and passing files between processes.
Upgrader is based on https://github.com/cloudflare/tableflip.
type Wrapper ¶ added in v0.5.0
Wrapper is an actor that wraps another actor. It is useful for creating middleware.
func LogServe ¶ added in v0.5.0
func LogServe(logger ServeLogger) Wrapper
LogServe returns an actor, i.e. an execute and interrupt func, that logs a message when a server is being started/shut down.