Documentation
¶
Overview ¶
Package temporal provides utility functions for the Temporal Go SDK.
Index ¶
- func FirstHistoryEvent(ctx context.Context, cc temporalsdk_client.Client, ...) (event *temporalapi_history.HistoryEvent, err error)
- func GetLogger(ctx context.Context) logr.Logger
- func HistoryEvents(ctx context.Context, cc temporalsdk_client.Client, ...) ([]*temporalapi_history.HistoryEvent, error)
- func Logger(logger logr.Logger) temporalsdk_log.Logger
- func NewLoggerInterceptor(logger logr.Logger) *workerInterceptor
- func NewNonRetryableError(err error) error
- func NonRetryableError(err error) bool
- type AutoHeartbeat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstHistoryEvent ¶ added in v0.8.0
func FirstHistoryEvent(ctx context.Context, cc temporalsdk_client.Client, exec *temporalapi_common.WorkflowExecution) (event *temporalapi_history.HistoryEvent, err error)
func HistoryEvents ¶ added in v0.8.0
func HistoryEvents(ctx context.Context, cc temporalsdk_client.Client, exec *temporalapi_common.WorkflowExecution, poll bool) ([]*temporalapi_history.HistoryEvent, error)
func Logger ¶
func Logger(logger logr.Logger) temporalsdk_log.Logger
Logger returns a logger for the Temporal Go SDK.
func NewLoggerInterceptor ¶
NewWorkerInterceptor returns an interceptor that makes the application logger available to activities via context.
func NewNonRetryableError ¶ added in v0.8.0
func NonRetryableError ¶
Types ¶
type AutoHeartbeat ¶
type AutoHeartbeat struct {
// contains filtered or unexported fields
}
func StartAutoHeartbeat ¶
func StartAutoHeartbeat(ctx context.Context) *AutoHeartbeat
StartAutoHeartbeat starts an auto-heartbeat helper for activities.
The interval is chosen to be one-third of the configured timeout to ensure frequent heartbeats. It is capped at a maximum of 10s to prevent the interval from being too large.
func Activity(ctx context.Context) error { h := temporal.StartAutoHeartbeat(ctx) defer h.Stop() // ... long running code. return nil }
Temporal is planning to provide auto-heartbeating capabilities in the future, see https://github.com/temporalio/features/issues/229 for more.
func (*AutoHeartbeat) Stop ¶
func (m *AutoHeartbeat) Stop()
Click to show internal directories.
Click to hide internal directories.