Code Monkey home page Code Monkey logo

Comments (10)

ybastide avatar ybastide commented on July 18, 2024

Interesting, but sounds confusing :-); what about another method, after_step or something?

from simpleflow.

ampelmann avatar ampelmann commented on July 18, 2024

As the original method is run, I think before_run and after_run are a good choice.

Maybe we should rename current before_run to before_first_run and after_run to after_last_run ?

from simpleflow.

ybastide avatar ybastide commented on July 18, 2024

Understood. This would be an API breakage though, so I like your first suggestion better (except it's breaking too... Inspect *_run expected arguments in a deprecation period? Don't care?)

from simpleflow.

ampelmann avatar ampelmann commented on July 18, 2024

Let @jbbarth be the judge 😄

from simpleflow.

jbbarth avatar jbbarth commented on July 18, 2024

before_run should be left as is: it's run on every replay for now ; we could parse the workflow execution history and try to determine if it's the first run (basically: 0 decision task taken so far), but I don't like that idea.

As for after_run, mixed feelings. I don't like the idea of a boolean, I'd better have two different explicit hooks after_run / after_finished. And yes, after_run should be run after any replay even if the workflow raises an ExecutionBlocked (but probably not in other cases if real decision errors occur). But that would break compat' and it's a super bad habit we have. So maybe alias the old after_run to after_finished and introduce a new after_replay or after_step for now? :( or inspect args

from simpleflow.

jbbarth avatar jbbarth commented on July 18, 2024

After thinking of it 5 mins, I like the word "replay" that emphasizes the fact that the code is re-played multiple times.

Proposal:

  • introduce before_replay, after_replay, after_finished
  • deprecate before_run and alias it to before_replay for now
  • deprecate after_run and alias it to after_finished for now

What do you think?

from simpleflow.

ybastide avatar ybastide commented on July 18, 2024

👍

from simpleflow.

ampelmann avatar ampelmann commented on July 18, 2024

👍

from simpleflow.

jbbarth avatar jbbarth commented on July 18, 2024

Cool :) @ampelmann I let you do this?

from simpleflow.

ampelmann avatar ampelmann commented on July 18, 2024

It would be a pleasure !

from simpleflow.

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.