Giter Club home page Giter Club logo

Comments (3)

llhhaa avatar llhhaa commented on July 3, 2024 1

Thanks for the response!

I appreciate your concerns, the initial implementation was indeed rudimentary. I was already working on the more sophisticated implementation in #152, and I think it addresses almost all of your concerns, so went ahead and opened it.

  • Supports play by returning the return value of the final actor in the chain.
  • Supports fail!, as it raises normally when an actor or play chain actor fails.
  • Supports rollback, though like call it will raise an error, and to access the failed actor state one still needs to use result.
    • I have a notion to add something like a last_rollback_value option, though I think this use case is niche enough that using result suffices.

By single type signature, I understand you to mean that call and result both return a ServiceActor::Result. I'll suggest that output_of is purely additive, it still leverages results, doesn't impinge on existing functionality, and just streamlines the accessing of result.explicit_output.

from actor.

sunny avatar sunny commented on July 3, 2024

Hi there! Thank you for bringing up this suggestion 🤗

While I understand the need for a more streamlined syntax I don’t think this is a good fit for the gem as it doesn’t work well with the idea of a single type of signature for actors, doesn’t allow for actors to be used in play and pass their outputs from one to the other, doesn’t allow for the fail! and rollback mechanisms.

While I think this is fine as a monkey-patch I’d rather not support it fully by adding this in the gem. As an extra precaution if you are using this I’d suggest adding output :_default_output to your ApplicationActor.

from actor.

sunny avatar sunny commented on July 3, 2024

Closed by #152. This is now possible using the .value(…) method.

Thanks @llhhaa 👏🏻

from actor.

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.