Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Merge 0f55b72 into b299fd8
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Francisco committed Nov 23, 2020
2 parents b299fd8 + 0f55b72 commit 24bc22e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions kytos/core/napps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,20 @@ def run(self):
It should not be overriden.
"""
self.notify_loaded()
LOG.info("Running NApp: %s", self)
self.execute()
while self.__interval > 0 and not self.__event.is_set():
self.__event.wait(self.__interval)
self.execute()

def notify_loaded(self):
"""Inform this NApp has been loaded."""
from kytos.core import KytosEvent
name = f'{self.username}/{self.name}.loaded'
event = KytosEvent(name=name, content={})
self.controller.buffers.app.put(event)

# all listeners receive event
def _shutdown_handler(self, event): # pylint: disable=unused-argument
"""Listen shutdown event from kytos.
Expand Down

0 comments on commit 24bc22e

Please sign in to comment.