Coder Social home page Coder Social logo

Comments (6)

lazypower avatar lazypower commented on September 3, 2024

+1 to this

Missing update-status, and upgrade-charm hooks leave me with reactive charms that don't respond properly when decorating with @hook() decorators, as the hook exits 0 - never reaching the proper hook context in the reactive methods.

from layer-basic.

johnsca avatar johnsca commented on September 3, 2024

I'm a little bit hesitant about including update-status by default, because would trigger any matching handler every time the hook was invoked, every 5 minutes. While this should be fine if the charms are coded well and are properly idempotent and properly gate behavior behind "if changed" clauses, it could still lead to more actions being taken on update-status than might be expected.

In some cases, this could actually be useful behavior, though, since sometimes it can be difficult to get a service to retry a hook that resulted in "blocked" status, but I wonder if it might not be worth gating it behind some sort of layer option?

from layer-basic.

marcoceppi avatar marcoceppi commented on September 3, 2024

Would it be possible for charm build to sniff all @hook decorators and add
hooks that are in a whitelist that wouldn't be added by default?

On Mon, Nov 16, 2015 at 3:41 PM Cory Johns [email protected] wrote:

I'm a little bit hesitant about including update-status by default,
because would trigger any matching handler every time the hook was invoked,
every 5 minutes. While this should be fine if the charms are coded well and
are properly idempotent and properly gate behavior behind "if changed"
clauses, it could still lead to more actions being taken on update-status
than might be expected.

In some cases, this could actually be useful behavior, though, since
sometimes it can be difficult to get a service to retry a hook that
resulted in "blocked" status, but I wonder if it might not be worth gating
it behind some sort of layer option?


Reply to this email directly or view it on GitHub
#4 (comment)
.

from layer-basic.

johnsca avatar johnsca commented on September 3, 2024

Not really, because of the external / non-python handlers; it's not really possible to introspect them.

I should perhaps clarify that I'm not entirely adverse to including update-status by default, but we would just need to make sure we call it out as a consideration in the docs.

from layer-basic.

johnsca avatar johnsca commented on September 3, 2024

#12
juju/charm-tools#67
#13

from layer-basic.

johnsca avatar johnsca commented on September 3, 2024

These are all available now.

from layer-basic.

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.