Giter Club home page Giter Club logo

Comments (4)

swyxio avatar swyxio commented on June 3, 2024

thanks for the note Sebastian!

guidelines how to handle dependencies (like services, database access layers, etc.) in Go based workflows/activities.

  1. i'm not sure i understand why you want Temporal to give you guidance on these things. The point of having idiomatic language SDKs is that it'd plug right in to your normal development workflow?

I struggled with getting the correct workflow name in workflow instances

  1. i'm interested in hearing more as that is something we can probably help with. An example would be nice!

3 ideas for how to do this:

from documentation.

swyxio avatar swyxio commented on June 3, 2024

hey Sebastian gonna close this for now, please feel free to reopen if you'd like to follow up on this!

from documentation.

sebholstein avatar sebholstein commented on June 3, 2024

Hey swyx,

didn't expect to see you here as I know you from the React/Svelte community :D

Let's take the ecommerce example to make it more clear: https://docs.temporal.io/blog/build-an-ecommerce-app-with-temporal-part-2-reminder-emails#sending-emails-from-an-activity

In this activity, the dependencies (like the mailing service) are tightened to the activity function. But I would like to pass the depedencies via the function params to be able to write good tests for it. From my understanding, these params must be serializable and always flow through the workspace code.

Can you show me how it's supposed to work in this situations? I have the same question for workspaces (which could also have deps that arent serializable).

from documentation.

tsurdilo avatar tsurdilo commented on June 3, 2024

@SebastianM
You can pass these types of dependencies to your activities when you register them with the worker, don't have to hard-code them in your activities as done in that example.
Another thing the Temporal testing framework provides is mocking of activities, which would allow you not to use the "real/prod" services that your activities may interact with, during unit/integration testing.

Feel free to ask any questions you might have on our community forum - https://community.temporal.io :)

from documentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.