Timer Interval Question

How can I make the @timer(interval=30) to be configurable via config or environment variable?
at runtime? say, i want to change the timer value to be 600 later by just uploading one of the environment variables, is it possible?

This is possible in Nameko 3 with the addition of the global config object. You could do simply:

from nameko import config

class Service:
    name = "timer"

    @timer(interval=config.get('TIMER_INTERVAL'))
    def ping(self):
        pass

See the PR here for the implementation.

Nameko 3 is available as a pre-release. pip install --pre nameko to get it.

Yes, the globally available config object is real game changer.
Not only one can have dynamic parameters of services, but services can be even dynamically generated from iterables in the config object.

We are going to use it in use case, where we have to monitor bunch of different urls in different intervals and store fetched content in S3 for other processing.