Cadence Workflow: Pass host specific objects like database connections, service clients, etc to activity implementation
问题 When a cadence worker comes up it initializes certain resources like database connections and client for other services. What is the correct pattern to make these resources accessible from activity implementations? 回答1: Go You can pass anything your activity needs via the context to your activity. Here is how it works: 1) Before you start your worker, set whatever you need as value to a context (below code happen at where you setup your worker): myThriftClient := ... // create my thrift