Documentation ¶
Index ¶
- Variables
- func IsWorkflowContextAsGoContext(ctx context.Context) bool
- func New(cfg *Config, z *zap.Logger) (Client, LazyTemporalClient, error)
- func NewFromClient(cfg *MonitorConfig, z *zap.Logger, tclient client.Client) (Client, LazyTemporalClient, error)
- func NewWorker(l *zap.Logger, client client.Client, qname string, cfg WorkerConfig) worker.Worker
- func NewWorkflowContextAsGOContext(ctx workflow.Context) context.Context
- func WithActivityOptions(wctx workflow.Context, qname string, ac ActivityConfig) workflow.Context
- func WithoutDeadlockDetection(f func())
- type ActivityConfig
- type Client
- type Config
- type LazyTemporalClient
- type MonitorConfig
- type WorkerConfig
- type WorkflowConfig
- type WorkflowContextAsGoContext
Constants ¶
This section is empty.
Variables ¶
var ( Configs = configset.Set[Config]{ Default: &Config{ Monitor: defaultMonitorConfig, }, Dev: &Config{ Monitor: defaultMonitorConfig, StartDevServerIfNotUp: true, DevServer: testsuite.DevServerOptions{ LogLevel: zapcore.WarnLevel.String(), EnableUI: true, DBFilename: filepath.Join(xdg.DataHomeDir(), "temporal_dev.sqlite"), }, EnableHelperRedirect: true, }, Test: &Config{ Monitor: defaultMonitorConfig, AlwaysStartDevServer: true, DevServer: testsuite.DevServerOptions{ LogLevel: zapcore.WarnLevel.String(), EnableUI: true, }, }, } )
Functions ¶
func IsWorkflowContextAsGoContext ¶ added in v0.9.2
func NewFromClient ¶ added in v0.3.1
func NewFromClient(cfg *MonitorConfig, z *zap.Logger, tclient client.Client) (Client, LazyTemporalClient, error)
func NewWorker ¶ added in v0.9.2
NewWorker creates a new Temporal worker. If the worker is disabled, returns nil.
func NewWorkflowContextAsGOContext ¶
Creates a new GO context that gets the Done() signal from the workflow context. Performing long running operations in the returned context will block the workflow execution, which will result in Temporal's deadlock detector kicking in and kickking your butt.
func WithActivityOptions ¶ added in v0.9.2
func WithoutDeadlockDetection ¶ added in v0.9.4
func WithoutDeadlockDetection(f func())
WithoutDeadlockDetection allows to execute the `f`, which does not perform any temporal operations (ie calling temporal using `wctx`) and thus might trigger the temporal deadlock detector.
This function is useful for `f`s that we know are slow and should not have their result cached by temporal - they need to run every workflow invocation, including during replays. Example usage is resource allocation.
See also https://github.com/temporalio/temporal/issues/6546. Blame Maxim, not me.
Types ¶
type ActivityConfig ¶ added in v0.9.2
type ActivityConfig struct { ScheduleToCloseTimeout time.Duration `koanf:"schedule_to_close_timeout"` StartToCloseTimeout time.Duration `koanf:"start_to_close_timeout"` HeartbeatTimeout time.Duration `koanf:"heartbeat_timeout"` ScheduleToStartTimeout time.Duration `koanf:"schedule_to_start_timeout"` }
Common way to define configuration that can be used in multiple modules, saving the need to repeat the same configuration in each module.
func (ActivityConfig) ToOptions ¶ added in v0.9.2
func (ac ActivityConfig) ToOptions(qname string) workflow.ActivityOptions
func (ActivityConfig) With ¶ added in v0.9.2
func (ac ActivityConfig) With(other ActivityConfig) ActivityConfig
other overrides self.
type Config ¶
type Config struct { Monitor MonitorConfig `koanf:"monitor"` AlwaysStartDevServer bool `koanf:"always_start_dev_server"` StartDevServerIfNotUp bool `koanf:"start_dev_server_if_not_up"` HostPort string `koanf:"hostport"` Namespace string `koanf:"namespace"` // DevServer.ClientOptions is not used. DevServer testsuite.DevServerOptions `koanf:"dev_server"` TLS tlsConfig `koanf:"tls"` EnableHelperRedirect bool `koanf:"enable_helper_redirect"` }
type LazyTemporalClient ¶ added in v0.9.2
type MonitorConfig ¶ added in v0.3.1
type WorkerConfig ¶ added in v0.9.2
type WorkerConfig struct { Disable bool `koanf:"disable"` WorkflowDeadlockTimeout time.Duration `koanf:"workflow_deadlock_timeout"` }
Common way to define configuration that can be used in multiple modules, saving the need to repeat the same configuration in each module.
func (WorkerConfig) With ¶ added in v0.9.2
func (wc WorkerConfig) With(other WorkerConfig) WorkerConfig
other overrides self.
type WorkflowConfig ¶ added in v0.9.2
Common way to define configuration that can be used in multiple modules, saving the need to repeat the same configuration in each module.
func (WorkflowConfig) ToStartWorkflowOptions ¶ added in v0.9.2
func (wc WorkflowConfig) ToStartWorkflowOptions(qname, id, sum string, memo map[string]string) client.StartWorkflowOptions
func (WorkflowConfig) With ¶ added in v0.9.2
func (wc WorkflowConfig) With(other WorkflowConfig) WorkflowConfig
other overrides self.
type WorkflowContextAsGoContext ¶
type WorkflowContextAsGoContext struct { workflow.Context // contains filtered or unexported fields }
func (*WorkflowContextAsGoContext) Deadline ¶
func (wctx *WorkflowContextAsGoContext) Deadline() (time.Time, bool)
func (*WorkflowContextAsGoContext) Done ¶
func (wctx *WorkflowContextAsGoContext) Done() <-chan struct{}
func (*WorkflowContextAsGoContext) Err ¶
func (wctx *WorkflowContextAsGoContext) Err() error
func (*WorkflowContextAsGoContext) Value ¶
func (wctx *WorkflowContextAsGoContext) Value(key any) any