Coder Social home page Coder Social logo

Comments (5)

gigxz avatar gigxz commented on July 23, 2024

One possibility is to use a celery schedule in Metagov Core, and allow Metagov Plugins to register task functions. Then the Plugin author doesn't have to worry about how the polling works.

  @Registry.plugin
  class MyPlugin(Plugin):

    @Registry.periodic_task
    def poll_events(self):
        """
        Function that gets called every minute/hour/day (however schedule is configured).
        Useful when you can't use a webhook.
        """
        events = requests.get(...) # fetch events from platform API 

        self.handle_event(event) # process event and send to driver

We need to be able to dynamically add and and remove scheduled tasks without restarting Django or Celery, as well as maybe dynamically changing the schedules (hourly/daily/etc) based on the plugin config.

from gateway.

shaunagm avatar shaunagm commented on July 23, 2024

I think it would be fantastic for metagov to implement polling - it would make things much easier for plugin authors. I don't really know enough about this topic to make any recommendations, though.

from gateway.

thelastjosh avatar thelastjosh commented on July 23, 2024

from gateway.

shaunagm avatar shaunagm commented on July 23, 2024

Yes, checking, not surveying.

from gateway.

gigxz avatar gigxz commented on July 23, 2024

The instructions to Drivers for how to perform async governance processes was made simpler from this change: https://docs.metagov.org/en/latest/driver_tutorial.html#performing-governance-processes

The instructions for Metagov installation was made more complicated, because of the need to set up Celery: https://docs.metagov.org/en/latest/installation.html

from gateway.

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.