Code Monkey home page Code Monkey logo

Comments (3)

lviggiano avatar lviggiano commented on June 3, 2024

Started working on branch "automatic-reload" 9056c8b

The idea is to have an annotation like @hotreload(checkInterval) on class level, example:

@HotReload(5L, TimeUnit.MINUTES)
interface MyConfig extends Config {...}

Something like this would happen:

PropertyInvokationHandler.invoke() -> PropertyLoader.ensureUpToDate() -> LoadPolicy.checkAndUpdate()

With proper thread synchronization.

from owner.

lviggiano avatar lviggiano commented on June 3, 2024

Basic reload is implemented.

The problem is that if the configuration is invalid (example, a non-numeric value for a method returning a numeric value) will generate an exception when the method is invoked, a runtime exception.

So, it would be best to have the validation feature, so that when reload is triggered the validation ensures that the new configuration is valid before to adopt it; and if it's not valid then the new configuration is discarded with some log message somewhere.

At the moment the reload happens synchronously (when a method on the proxy is invoked), but it would be nice if the user could chose also an asynchronous reload (by a thread in background) with a notification mechanism based on listeners.

Things to be done before completing this issue:

  • more tests
  • validation #30
  • documentation
  • asynchronous reload
  • notifications (ReloadEvent, ReloadListener)

from owner.

lviggiano avatar lviggiano commented on June 3, 2024

Documentation written to http://owner.aeonbits.org/docs/reload/

The validation will be postponed after 1.0.4 release probably. Hot reload can also live without validation for the moment.

from owner.

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.