Coder Social home page Coder Social logo

Comments (9)

mikhailshilkov avatar mikhailshilkov commented on August 19, 2024

Hi @richardjharding thanks for bringing this up. I haven't added this method to the API yet.
It might make sense to add a new function to Orchestrator module, something like Orchestrator.runEternal. Would that make sense?

from durablefunctions.fsharp.

richardjharding avatar richardjharding commented on August 19, 2024

Yes that sounds perfect, btw my approach didn't work I think because I couldn't await the result of the Orchestrator.run and so continue as new ended up replaying some of the already running orchestration (that's at least what it looked like)

I tried adding the function to the Orchestrator myself but couldn't work out what I needed to add to the CE to make it work

from durablefunctions.fsharp.

mikhailshilkov avatar mikhailshilkov commented on August 19, 2024

I pushed a quick-n-dirty version of it into #14. Is there a way you could try it for your scenario before I merge?

from durablefunctions.fsharp.

richardjharding avatar richardjharding commented on August 19, 2024

Great I'll give a test first thing tomorrow, one thing occurred to me there may be a scenario where the call to continue as new would need to be conditional - or some check on stored state, or external event would mean that continue as new would not be called and orchestration would terminate? Do you think that would be accommodated?

from durablefunctions.fsharp.

mikhailshilkov avatar mikhailshilkov commented on August 19, 2024

Great!

Do you think that would be accommodated?

Not now. I want to give it another thought tomorrow. My first idea is to return something from the workflow that would indicate whether continuation is needed. It could be just a boolean or an Option<T> with Some T meaning continue and pass T as the parameter to ContinueAsNew (means we need to support getting that value too, which makes sense). Although passing Some null doesn't sound awesome, maybe I'd come up with a brand-new DU.

Any ideas are more than welcome!

from durablefunctions.fsharp.

richardjharding avatar richardjharding commented on August 19, 2024

ok have given #14 a quick test and its working perfectly - I can see the new execution id in the history table so looks good to me
As for the options you mention - I do think it needs some way to pass a param to the ContinueAsNew as it would match the C# implementation - agree passing Some null doesn't seem very F# - as you say perhaps some new DU - something like a Result type maybe?

from durablefunctions.fsharp.

mikhailshilkov avatar mikhailshilkov commented on August 19, 2024

@richardjharding I took a stab at stoppable orchestration - see the latest commit in the same PR.

Now, the word "eternal" looks really weird in the context of stopping... Any ideas about better names? On the other hand, this is what the original library uses...

from durablefunctions.fsharp.

richardjharding avatar richardjharding commented on August 19, 2024

Works great - I like the "command" approach - I think Eternal is fine - I think in this case its better to match the C# implementation/docs - makes it easier to discover and translate other samples

from durablefunctions.fsharp.

mikhailshilkov avatar mikhailshilkov commented on August 19, 2024

I merged the PR and bumped a new version of the nuget package - let me know if you get any issues with it. Thanks for helping out!

from durablefunctions.fsharp.

Related Issues (9)

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.