Documentation ¶
Overview ¶
Package cadence and its subdirectories contain a Cadence client side framework.
The Cadence service is a task orchestrator for your application’s tasks. Applications using Cadence can execute a logical flow of tasks, especially long-running business logic, asynchronously or synchronously. and can scale runtime on distributed systems without you, the service owner, worrying about infrastructure needs.
A quick example illustrates its use case. Consider Uber Eats where Cadence manages the entire business flow from placing an order, accepting it, handling shopping cart processes (adding, updating, and calculating cart items), entering the order in a pipeline (for preparing food and coordinating delivery), to scheduling delivery as well as handling payments.
Cadence consists of a programming framework (or client library) and a managed service (or backend). The framework enables developers to author and coordinate tasks in Go code.
The root cadence package contains common data structures. The subpackages are:
workflow - functions used to implement workflows
activity - functions used to implement activities
client - functions used to create Cadence service client used to start and monitor workflow executions.
worker - functions used to create worker instance used to host workflow and activity code.
testsuite - unit testing framework for activity and workflow testing.
Index ¶
Constants ¶
const LibraryVersion = internal.LibraryVersion
LibraryVersion is a semver string that represents the version of this cadence client library it will be embedded as a "version" header in every rpc call made by this client to cadence server. In addition, the version string will be used by the server to enforce compatibility checks Update to this version number is typically done by the cadence team as part of a major feature or behavior change
Variables ¶
var ErrNoData = internal.ErrNoData
ErrNoData is returned when trying to extract strong typed data while there is no data available.
Functions ¶
func IsCanceledError ¶ added in v0.5.1
IsCanceledError return if the err is a CanceledError
func IsCustomError ¶ added in v0.5.1
IsCustomError return if the err is a CustomError
func IsGenericError ¶ added in v0.5.1
IsGenericError return if the err is a GenericError
func IsPanicError ¶ added in v0.5.1
IsPanicError return if the err is a PanicError
func IsTerminatedError ¶ added in v0.5.1
IsTerminatedError return if the err is a TerminatedError
func IsTimeoutError ¶ added in v0.5.1
IsTimeoutError return if the err is a TimeoutError
Types ¶
type CanceledError ¶
type CanceledError = internal.CanceledError
CanceledError returned when operation was canceled.
func NewCanceledError ¶
func NewCanceledError(details ...interface{}) *CanceledError
NewCanceledError creates CanceledError instance. Return this error from activity or child workflow to indicate that it was successfully cancelled.
type CustomError ¶
type CustomError = internal.CustomError
CustomError returned from workflow and activity implementations with reason and optional details.
func NewCustomError ¶
func NewCustomError(reason string, details ...interface{}) *CustomError
NewCustomError create new instance of *CustomError with reason and optional details. Use CustomError for any use case specific errors that cross activity and child workflow boundaries.
Directories ¶
Path | Synopsis |
---|---|
Package activity contains functions and types used to implement Cadence activities.
|
Package activity contains functions and types used to implement Cadence activities. |
Package client contains functions to create Cadence clients used to communicate to Cadence service.
|
Package client contains functions to create Cadence clients used to communicate to Cadence service. |
Package encoded contains wrappers that are used for binary payloads deserialization.
|
Package encoded contains wrappers that are used for binary payloads deserialization. |
cmd/dummy
This file exists to force compilation of all code that doesn't have unit tests.
|
This file exists to force compilation of all code that doesn't have unit tests. |
tools
Module
|
|
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
|
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 |
Package testsuite contains unit testing framework for Cadence workflows and activities.
|
Package testsuite contains unit testing framework for Cadence workflows and activities. |
Package worker contains functions to manage lifecycle of a Cadence client side worker.
|
Package worker contains functions to manage lifecycle of a Cadence client side worker. |
Package workflow contains functions and types used to implement Cadence workflows.
|
Package workflow contains functions and types used to implement Cadence workflows. |