How to trigger some rpc entrypoints when service is started?

I do it like this:

from nameko.extensions import Entrypoint

class Start(Entrypoint):

    def start(self):
        self.container.spawn_worker(self, (), {})

on_start = Start.decorator


class OdooService:
    name = 'odoo'

    @on_start
    def on_service_start(self):
        logger.debug('Odoo service start.')
1 Like