uber / cadence

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.
https://cadenceworkflow.io
MIT License
7.99k stars 776 forks source link

Generic activity implementation, specific context #1350

Open keeblerelvis opened 5 years ago

keeblerelvis commented 5 years ago

Is there any concept of an activity context (a string)? I'm considering creating a DSL for our use case (only a POC for the moment) where there would be a small handful of activity implementations, but many different named activities that should appear to be different, whose implementation is actually just one of the small handful.

Maybe you'd have to do:

worker.registerActivitiesImplementations(new GenericActivitiesImpl(), "namedActivities1");
worker.registerActivitiesImplementations(new GenericActivitiesImpl(), "namedActivities2");

and the activities implementation would be passed that name.

Ideally cadence knows it, and the History console says, for example, "Activity X: GenericActivities::genericStep namedActivity1".

Still very new to cadence (but very excited about it - looks great!), so my question might be misguided. Apologies if I should have gone elsewhere to ask this. Please redirect me if so.

thank you Daniel

mfateev commented 5 years ago

Sorry for the delayed response. The ability to provide a generic activity implementation similar to Java dynamic proxy is a really nice feature for some generic use cases. I'll update this issue once it is implemented.

keeblerelvis commented 5 years ago

Yes exactly like dynamic proxy. That's great! I'll keep an eye out. Thanks very much!