Git Product home page Git Product logo

Comments (3)

graemerocher avatar graemerocher commented on May 28, 2024 1

I think the only way to solve this would be to eagerly initialise beans with @Scheduled with expressions. Since it is a chicken and egg problem. Currently code doesn't create the instance until the job is actually run but a cron expression that references this needs to create the instance to compute the schedule.

from micronaut-core.

graemerocher avatar graemerocher commented on May 28, 2024

so currently the cron expression is retrieved before the job instance is created so there is no way to refer to this. You could create a global custom expression context to referred to another bean though.

from micronaut-core.

hrothwell avatar hrothwell commented on May 28, 2024

@graemerocher with the intent being to have one annotated method in an abstract class and all classes possibly having a different cron schedule in the annotation, so I'm not sure that that would quite work πŸ€” If we referred to another bean, we'd probably still need to pass something like what the class name is in that case which I would assume would also reference this (something like this.javaClass.simpleName). Not a big deal either way, just thought I'd reach out and see if I was doing something wrong, bug, or just not feasible for the time being.

from micronaut-core.

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.