File tree Expand file tree Collapse file tree 2 files changed +36
-4
lines changed Expand file tree Collapse file tree 2 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,24 @@ type HeaderReader interface {
36
36
ForEachKey (handler func (string , []byte ) error ) error
37
37
}
38
38
39
- // ContextPropagator is an interface that determines what information from
40
- // context to pass along
39
+ // ContextPropagator determines what information from context to pass along.
40
+ //
41
+ // The information passed is called Headers - a sequence of string to []byte
42
+ // tuples of serialized data that should follow workflow and activity execution
43
+ // around.
44
+ //
45
+ // Inject* methods are used on the way from the process to persistence in
46
+ // Cadence - thus they use HeaderWriter-s to write the metadata. Extract*
47
+ // methods are used on the way from persisted state in Cadence to execution
48
+ // - thus they use HeaderReader-s to read the metadata and fill it in the
49
+ // returned context. Returning error from Extract* methods prevents the
50
+ // successful workflow run.
51
+ //
52
+ // The whole sequence of execution is:
53
+ //
54
+ // Process initiating the workflow -> Inject -> Cadence -> Go Workflow Worker
55
+ // -> ExtractToWorkflow -> Start executing a workflow -> InjectFromWorkflow ->
56
+ // Cadence -> Go Activity Worker -> Extract -> Execute Activity
41
57
type ContextPropagator interface {
42
58
// Inject injects information from a Go Context into headers
43
59
Inject (context.Context , HeaderWriter ) error
Original file line number Diff line number Diff line change @@ -29,7 +29,23 @@ type (
29
29
// HeaderWriter is an interface to write information to cadence headers
30
30
HeaderWriter = internal.HeaderWriter
31
31
32
- // ContextPropagator is an interface that determines what information from
33
- // context to pass along
32
+ // ContextPropagator determines what information from context to pass along.
33
+ //
34
+ // The information passed is called Headers - a sequence of string to []byte
35
+ // tuples of serialized data that should follow workflow and activity execution
36
+ // around.
37
+ //
38
+ // Inject* methods are used on the way from the process to persistence in
39
+ // Cadence - thus they use HeaderWriter-s to write the metadata. Extract*
40
+ // methods are used on the way from persisted state in Cadence to execution
41
+ // - thus they use HeaderReader-s to read the metadata and fill it in the
42
+ // returned context. Returning error from Extract* methods prevents the
43
+ // successful workflow run.
44
+ //
45
+ // The whole sequence of execution is:
46
+ //
47
+ // Process initiating the workflow -> Inject -> Cadence -> Go Workflow Worker
48
+ // -> ExtractToWorkflow -> Start executing a workflow -> InjectFromWorkflow ->
49
+ // Cadence -> Go Activity Worker -> Extract -> Execute Activity
34
50
ContextPropagator = internal.ContextPropagator
35
51
)
You can’t perform that action at this time.
0 commit comments